Blame view

framework/dev/SapphireTestSuite.php 627 Bytes
0084d336   Administrator   Importers CRUD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <?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 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();
  		}
  	}
  	
  	public function tearDown() {
  		foreach($this->groups as $group) {
  			if($group[0] instanceof SapphireTest) $group[0]->tearDownOnce();
  		}
  	}
  }