Skip to content

Commit

Permalink
Dev: Don't dump database after tests; reset db after db tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 16, 2017
1 parent 621dc61 commit 85350cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/helpers/UpdateDbHelperTest.php
Expand Up @@ -40,6 +40,11 @@ public static function teardownAfterClass()
// Only this error is OK.
self::assertTrue(strpos($msg, 'database doesn\'t exist') !== false);
}

$dbo->setActive(false);
unset($dbo);
$config = require(\Yii::app()->getBasePath() . '/config/config.php');
\Yii::app()->setComponent('db', $config['components']['db'], false);
}

/**
Expand Down Expand Up @@ -73,6 +78,7 @@ public function testInstallSql()
$this->assertEquals([], $result, 'No error messages from _executeSQLFile');

// Dump database to file.
/*
$output = array();
$result = exec(
sprintf(
Expand All @@ -84,6 +90,7 @@ public function testInstallSql()
);
$this->assertEmpty($output, 'No output from mysqldump');
$this->assertEmpty($result, 'No last line output from mysqldump');
*/

// Connect to old database.
\Yii::app()->setComponent('db', $config['components']['db'], false);
Expand Down Expand Up @@ -112,6 +119,7 @@ public function testInstallPHP()
}

// Dump database to file.
/*
$output = array();
$result = exec(
sprintf(
Expand All @@ -123,6 +131,7 @@ public function testInstallPHP()
);
$this->assertEmpty($output, 'No output from mysqldump');
$this->assertEmpty($result, 'No last line output from mysqldump');
*/

// Connect to old database.
\Yii::app()->setComponent('db', $config['components']['db'], false);
Expand All @@ -142,6 +151,7 @@ public function testDbUpgradeFrom258()
$config = require(\Yii::app()->getBasePath() . '/config/config.php');

// Dump database to file.
/*
$output = array();
$result = exec(
sprintf(
Expand All @@ -153,6 +163,7 @@ public function testDbUpgradeFrom258()
);
$this->assertEmpty($output, 'No output from mysqldump');
$this->assertEmpty($result, 'No last line output from mysqldump');
*/

// Connect to old database.
\Yii::app()->setComponent('db', $config['components']['db'], false);
Expand Down

0 comments on commit 85350cc

Please sign in to comment.