diff --git a/src/TestSuite/Fixture/FixtureInjector.php b/src/TestSuite/Fixture/FixtureInjector.php index 180010f6766..504fe3db251 100644 --- a/src/TestSuite/Fixture/FixtureInjector.php +++ b/src/TestSuite/Fixture/FixtureInjector.php @@ -124,6 +124,7 @@ public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time * @return void */ public function startTest(PHPUnit_Framework_Test $test) { + $this->_fixtureManager->load($test); } /** @@ -134,6 +135,7 @@ public function startTest(PHPUnit_Framework_Test $test) { * @return void */ public function endTest(PHPUnit_Framework_Test $test, $time) { + $this->_fixtureManager->unload($test); } /** diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php index 246885e6731..331257bda98 100644 --- a/src/TestSuite/TestCase.php +++ b/src/TestSuite/TestCase.php @@ -69,43 +69,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { */ protected $_pathRestore = array(); -/** - * Runs the test case and collects the results in a TestResult object. - * If no TestResult object is passed a new one will be created. - * This method is run for each test method in this class - * - * @param \PHPUnit_Framework_TestResult $result - * @return \PHPUnit_Framework_TestResult - */ - public function run(\PHPUnit_Framework_TestResult $result = null) { - if (!empty($this->fixtureManager)) { - $this->fixtureManager->load($this); - } - $result = parent::run($result); - if (!empty($this->fixtureManager)) { - $this->fixtureManager->unload($this); - } - return $result; - } - -/** - * Called when a test case method is about to start (to be overridden when needed.) - * - * @param string $method Test method about to get executed. - * @return void - */ - public function startTest($method) { - } - -/** - * Called when a test case method has been executed (to be overridden when needed.) - * - * @param string $method Test method about that was executed. - * @return void - */ - public function endTest($method) { - } - /** * Overrides SimpleTestCase::skipIf to provide a boolean return value * @@ -164,30 +127,6 @@ public static function date($format = 'Y-m-d H:i:s') { return TestSuiteDispatcher::date($format); } -// @codingStandardsIgnoreStart PHPUnit overrides don't match CakePHP - -/** - * Announces the start of a test. - * - * @return void - */ - protected function assertPreConditions() { - parent::assertPreConditions(); - $this->startTest($this->getName()); - } - -/** - * Announces the end of a test. - * - * @return void - */ - protected function assertPostConditions() { - parent::assertPostConditions(); - $this->endTest($this->getName()); - } - -// @codingStandardsIgnoreEnd - /** * Chooses which fixtures to load for a given test *