From 9305f55e926adfea6ef4e9de73be1b058bcf8a98 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 3 Nov 2016 10:19:44 +0100 Subject: [PATCH] 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 b9987d22..cd250759 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();