2009-04-22 05:22:09 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Light wrapper around {@link PHPUnit_Framework_TestSuite}
|
|
|
|
* which allows to have {@link setUp()} and {@link tearDown()}
|
|
|
|
* methods which are called just once per suite, not once per
|
|
|
|
* test method in each suite/case.
|
|
|
|
*
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2009-04-22 05:22:09 +02:00
|
|
|
* @subpackage testing
|
|
|
|
*/
|
|
|
|
class SapphireTestSuite extends PHPUnit_Framework_TestSuite {
|
2012-09-19 12:07:39 +02:00
|
|
|
public function setUp() {
|
2009-04-22 05:22:09 +02:00
|
|
|
foreach($this->groups as $group) {
|
2010-04-12 03:52:39 +02:00
|
|
|
if($group[0] instanceof SapphireTest) $group[0]->setUpOnce();
|
2009-04-22 05:22:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function tearDown() {
|
2009-04-22 05:22:09 +02:00
|
|
|
foreach($this->groups as $group) {
|
2010-04-12 03:52:39 +02:00
|
|
|
if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
|
2009-04-22 05:22:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|