[icinga-checkins] icinga.org: icingaweb2-module-director/master: BaseTestCase: Support more resource settings via ENV

git at icinga.org git at icinga.org
Thu Nov 3 10:20:11 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 9305f55e926adfea6ef4e9de73be1b058bcf8a98
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=9305f55e926adfea6ef4e9de73be1b058bcf8a98

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Nov  3 10:19:44 2016 +0100

BaseTestCase: Support more resource settings via ENV

---

 library/Director/Test/BaseTestCase.php |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/library/Director/Test/BaseTestCase.php b/library/Director/Test/BaseTestCase.php
index b9987d2..cd25075 100644
--- a/library/Director/Test/BaseTestCase.php
+++ b/library/Director/Test/BaseTestCase.php
@@ -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();



More information about the icinga-checkins mailing list