mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing some issues with tables that were not beign droppend at the end of test suite execution
This commit is contained in:
parent
714d8298c4
commit
5538529c41
3 changed files with 4 additions and 11 deletions
|
@ -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];
|
||||
|
|
|
@ -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))) {
|
||||
|
|
|
@ -102,7 +102,5 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
|
|||
if ($this->_fixtureManager) {
|
||||
$this->_fixtureManager->shutDown();
|
||||
}
|
||||
$this->_fixtureManager = null;
|
||||
$this->sharedFixture = null;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue