Fixing some issues with tables that were not beign droppend at the end of test suite execution

This commit is contained in:
José Lorenzo Rodríguez 2010-09-25 19:15:26 -04:30
parent 714d8298c4
commit 5538529c41
3 changed files with 4 additions and 11 deletions

View file

@ -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];

View file

@ -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))) {

View file

@ -102,7 +102,5 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
if ($this->_fixtureManager) {
$this->_fixtureManager->shutDown();
}
$this->_fixtureManager = null;
$this->sharedFixture = null;
}
}