BaseTestCase: Support more resource settings via ENV

This commit is contained in:
Markus Frosch 2016-11-03 10:19:44 +01:00
parent 10ee7901c8
commit 9305f55e92
1 changed files with 6 additions and 0 deletions

View File

@ -65,9 +65,15 @@ class BaseTestCase extends PHPUnit_Framework_TestCase
if (array_key_exists('DIRECTOR_TESTDB', $_SERVER)) {
$dbConfig->dbname = $_SERVER['DIRECTOR_TESTDB'];
}
if (array_key_exists('DIRECTOR_TESTDB_HOST', $_SERVER)) {
$dbConfig->host = $_SERVER['DIRECTOR_TESTDB_HOST'];
}
if (array_key_exists('DIRECTOR_TESTDB_USER', $_SERVER)) {
$dbConfig->username = $_SERVER['DIRECTOR_TESTDB_USER'];
}
if (array_key_exists('DIRECTOR_TESTDB_PASSWORD', $_SERVER)) {
$dbConfig->password = $_SERVER['DIRECTOR_TESTDB_PASSWORD'];
}
$this->db = new Db($dbConfig);
$migrations = new Migrations($this->db);
$migrations->applyPendingMigrations();