From f586ed03942a943949ae995ead12e0f23c3f8827 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 12 Feb 2011 16:45:26 -0500 Subject: [PATCH] Initial ugly re-factor of where fixtures are done. --- cake/tests/lib/cake_test_runner.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cake/tests/lib/cake_test_runner.php b/cake/tests/lib/cake_test_runner.php index 632f88fcb..2cd81897c 100644 --- a/cake/tests/lib/cake_test_runner.php +++ b/cake/tests/lib/cake_test_runner.php @@ -27,14 +27,16 @@ PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); */ class CakeTestRunner extends PHPUnit_TextUI_TestRunner { - -/** - * Sets the proper test suite to use and loads the test file in it. - * this method gets called as a callback from the parent class - * - * @return void - */ - protected function handleCustomTestSuite() { - + public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array()) { + $fixture = new CakeFixtureManager; + foreach ($suite->getIterator() as $test) { + if ($test instanceof CakeTestCase) { + $fixture->fixturize($test); + $test->fixtureManager = $fixture; + } + } + $r = parent::doRun($suite, $arguments); + $fixture->shutdown(); + return $r; } } \ No newline at end of file