Adding the new class CakeTestSuite to setup some utility stuff like fixtures outside of CakeTestCase

This commit is contained in:
José Lorenzo Rodríguez 2010-05-08 15:53:29 -04:30
parent acb9733d0e
commit ec9c8b4d49

View file

@ -0,0 +1,29 @@
<?php
class CakeTestSuite extends PHPUnit_Framework_TestSuite {
protected $_fixtureManager = null;
public function setFixtureManager(CakeFixtureManager $manager) {
$this->_fixtureManager = $manager;
}
protected function setUp() {
parent::setUp();
if (!$this->_fixtureManager) {
return;
}
$classes = array();
foreach ($this->getIterator() as $test) {
$this->_fixtureManager->fixturize($test);
}
$this->sharedFixture = $this->_fixtureManager;
}
protected function tearDown() {
parent::tearDown();
$this->_fixtureManager->shutDown();
$this->_fixtureManager = null;
$this->sharedFixture = null;
}
}