mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 09:14:09 +02:00
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…
x
Reference in New Issue
Block a user