BaseTestCase: Support more resource settings via ENV
This commit is contained in:
parent
10ee7901c8
commit
9305f55e92
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue