From 5538529c4103e1bb4b76a57eb15d5c4e189da0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Sat, 25 Sep 2010 19:15:26 -0430 Subject: [PATCH] Fixing some issues with tables that were not beign droppend at the end of test suite execution --- cake/tests/lib/cake_fixture_manager.php | 12 ++++-------- cake/tests/lib/cake_test_fixture.php | 1 - cake/tests/lib/cake_test_suite.php | 2 -- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cake/tests/lib/cake_fixture_manager.php b/cake/tests/lib/cake_fixture_manager.php index dd67cf615..ea9add368 100644 --- a/cake/tests/lib/cake_fixture_manager.php +++ b/cake/tests/lib/cake_fixture_manager.php @@ -89,10 +89,12 @@ class CakeFixtureManager { // Try for test DB @$db = ConnectionManager::getDataSource('test'); $testDbAvailable = $db->isConnected(); + } else { + throw new MissingConnectionException(__('You need to create a $test datasource connection to start using fixtures')); } if (!$testDbAvailable) { - throw new MissingConnectionException(__('You need to create a $test datasource connection to start using fixtures')); + throw new MissingConnectionException(__('Unable to connect to the $test datasource')); } $this->_db = $db; @@ -220,13 +222,7 @@ class CakeFixtureManager { * @return void */ public function unload(CakeTestCase $test) { - if (empty($test->fixtures)) { - return; - } - $fixtures = $test->fixtures; - if (empty($fixtures)) { - return; - } + $fixtures = !empty($test->fixtures) ? $test->fixtures : array(); foreach ($fixtures as $f) { if (isset($this->_loaded[$f])) { $fixture = $this->_loaded[$f]; diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 7354cf880..bb3571c61 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -60,7 +60,6 @@ class CakeTestFixture { /** * Initialize the fixture. * - * @param object Cake's DBO driver (e.g: DboMysql). */ public function init() { if (isset($this->import) && (is_string($this->import) || is_array($this->import))) { diff --git a/cake/tests/lib/cake_test_suite.php b/cake/tests/lib/cake_test_suite.php index eaf4f1752..0bfb74d8e 100644 --- a/cake/tests/lib/cake_test_suite.php +++ b/cake/tests/lib/cake_test_suite.php @@ -102,7 +102,5 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite { if ($this->_fixtureManager) { $this->_fixtureManager->shutDown(); } - $this->_fixtureManager = null; - $this->sharedFixture = null; } } \ No newline at end of file