Skip to content
Permalink
Browse files

Fixing some issues with tables that were not beign droppend at the en…

…d of test suite execution
  • Loading branch information...
lorenzo committed Sep 25, 2010
1 parent 714d829 commit 5538529c4103e1bb4b76a57eb15d5c4e189da0ec
@@ -89,10 +89,12 @@ protected function _initDb() {
// 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 @@ public function load(CakeTestCase $test) {
* @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];
@@ -60,7 +60,6 @@ public function __construct() {
/**
* 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))) {
@@ -102,7 +102,5 @@ protected function tearDown() {
if ($this->_fixtureManager) {
$this->_fixtureManager->shutDown();
}
$this->_fixtureManager = null;
$this->sharedFixture = null;
}
}

0 comments on commit 5538529

Please sign in to comment.
You can’t perform that action at this time.