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 class SapphireTestSuite extends PHPUnit_Framework_TestSuite {
12 function setUp() {
13 foreach($this->groups as $group) {
14 if($group[0] instanceof SapphireTest) $group[0]->setUpOnce();
15 }
16 }
17
18 function tearDown() {
19 foreach($this->groups as $group) {
20 if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
21 }
22 }
23 }
24 ?>