1 <?php
2 /**
3 * Light wrapper around {@link PHPUnit_Framework_TestSuite}
4 * which allows to have {@link setUp()} and {@link tearDown()}
5 * methods which are called just once per suite, not once per
6 * test method in each suite/case.
7 *
8 * @package sapphire
9 * @subpackage testing
10 */
11
12 require_once 'PHPUnit/Framework/Test.php';
13 require_once 'PHPUnit/Framework/SelfDescribing.php';
14 require_once 'PHPUnit/Framework/TestSuite.php';
15
16 class SapphireTestSuite extends PHPUnit_Framework_TestSuite {
17 function setUp() {
18 foreach($this->groups as $group) {
19 if($group[0] instanceof SapphireTest) $group[0]->setUpOnce();
20 }
21 }
22
23 function tearDown() {
24 foreach($this->groups as $group) {
25 if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
26 }
27 }
28 }
29 ?>