silverstripe-framework/dev/SapphireTestSuite.php

24 lines
625 B
PHP
Raw Permalink Normal View History

<?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.
2014-08-15 08:53:05 +02:00
*
* @package framework
* @subpackage testing
*/
class SapphireTestSuite extends PHPUnit_Framework_TestSuite {
public function setUp() {
foreach($this->groups as $group) {
if($group[0] instanceof SapphireTest) $group[0]->setUpOnce();
}
}
2014-08-15 08:53:05 +02:00
public function tearDown() {
foreach($this->groups as $group) {
if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
}
}
}