diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php index e207bdcec..5af4442de 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php @@ -234,8 +234,8 @@ class CakeTestCaseTest extends CakeTestCase { $manager = $this->getMock('CakeFixtureManager'); $manager->fixturize($test); $test->fixtureManager = $manager; - $manager->expects($this->once())->method('load'); - $manager->expects($this->once())->method('unload'); + $manager->expects($this->never())->method('load'); + $manager->expects($this->never())->method('unload'); $result = $test->run(); $this->assertEquals(0, $result->errorCount()); $this->assertTrue($result->wasSuccessful()); @@ -269,6 +269,7 @@ class CakeTestCaseTest extends CakeTestCase { $manager = $this->getMock('CakeFixtureManager'); $manager->fixturize($test); $test->fixtureManager = $manager; + $manager->expects($this->never())->method('unload'); $manager->expects($this->once())->method('loadSingle'); $result = $test->run(); $this->assertEquals(0, $result->errorCount()); @@ -285,7 +286,6 @@ class CakeTestCaseTest extends CakeTestCase { $manager = $this->getMock('CakeFixtureManager'); $manager->fixturize($test); $test->fixtureManager = $manager; - $manager->expects($this->once())->method('unload'); $result = $test->run(); $this->assertEquals(1, $result->errorCount()); } diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index c9512f420..ba51d9f34 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -66,34 +66,6 @@ abstract class CakeTestCase 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 The test result object - * @return PHPUnit_Framework_TestResult - * @throws InvalidArgumentException - */ - public function run(PHPUnit_Framework_TestResult $result = null) { - $level = ob_get_level(); - - if (!empty($this->fixtureManager)) { - $this->fixtureManager->load($this); - } - $result = parent::run($result); - if (!empty($this->fixtureManager)) { - $this->fixtureManager->unload($this); - unset($this->fixtureManager, $this->db); - } - - for ($i = ob_get_level(); $i < $level; ++$i) { - ob_start(); - } - - return $result; - } - /** * Called when a test case method is about to start (to be overridden when needed.) *