Skip to content

Commit

Permalink
Dev: Must deactivate database before switching component (tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Dec 12, 2017
1 parent 3a0571b commit b37edf2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/helpers/CheckDatabaseJsonValuesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function testCreate()
$this->checkTemplateConfigurationJson($inst->connection);

// Connect to old database.
$db->setActive(false);
\Yii::app()->setComponent('db', $config['components']['db'], false);
$db->setActive(true);
}
Expand All @@ -72,6 +73,7 @@ public function testUpdateFrom258()
$this->checkTemplateConfigurationJson($connection);

$db = \Yii::app()->getDb();
$db->setActive(false);
$config = require(\Yii::app()->getBasePath() . '/config/config.php');
\Yii::app()->setComponent('db', $config['components']['db'], false);
$db->setActive(true);
Expand All @@ -88,6 +90,7 @@ public function testUpdateFrom315()
$this->checkTemplateConfigurationJson($connection);

$db = \Yii::app()->getDb();
$db->setActive(false);
$config = require(\Yii::app()->getBasePath() . '/config/config.php');
\Yii::app()->setComponent('db', $config['components']['db'], false);
$db->setActive(true);
Expand Down

0 comments on commit b37edf2

Please sign in to comment.