mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding the new class CakeTestSuite to setup some utility stuff like fixtures outside of CakeTestCase
This commit is contained in:
parent
acb9733d0e
commit
ec9c8b4d49
1 changed files with 29 additions and 0 deletions
29
cake/tests/lib/cake_test_suite.php
Normal file
29
cake/tests/lib/cake_test_suite.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue