Version: current

     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 ?>

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -