silverstripe-framework/dev/SapphireTestSuite.php
Sam Minnee 5296f59d23 API CHANGE: Renamed SapphireTest::set_up_once/tear_down_once to setUpOnce/tearDownOnce, and made them instance methods.
API CHANGE: Added SapphireTest::$illegalExtensions and SapphireTest::$requiredExtensions for making tests depending on particular extension sets (from r89958)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96727 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:03 +13:00

24 lines
614 B
PHP

<?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.
*
* @package sapphire
* @subpackage testing
*/
class SapphireTestSuite extends PHPUnit_Framework_TestSuite {
function setUp() {
foreach($this->groups as $group) {
if($group[0] instanceof SapphireTest) $group[0]->setUpOnce();
}
}
function tearDown() {
foreach($this->groups as $group) {
if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
}
}
}
?>