Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenaka <diosmosis@users.noreply.github.com>2017-09-27 00:00:28 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-09-27 00:00:28 +0300
commit6d7fbab50b408e8dab711c71afa374ec0f0fbcef (patch)
treee3af22aaecbb3da6abfccc7d20dddd88fb8efde3 /tests/PHPUnit
parent948e1f04b48b7f6a8ef7d0f0421bf075feb9003a (diff)
Pass --piwik-domain value to phpunit via environment variable so correct INI config will be used in tests. (#12119)
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r--tests/PHPUnit/bootstrap.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index 313f8f4b6a..444728bafd 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -44,6 +44,16 @@ if (getenv('PIWIK_USE_XHPROF') == 1) {
\Piwik\Profiler::setupProfilerXHProf();
}
+function setPiwikDomainFromEnvVar()
+{
+ $piwikDomain = getenv('PIWIK_DOMAIN');
+ if (!empty($piwikDomain)) {
+ $_SERVER['HTTP_HOST'] = $piwikDomain;
+ }
+}
+
+setPiwikDomainFromEnvVar();
+
// setup container for tests
function setupRootContainer() {
// before running tests, delete the TestingEnvironmentVariables file, since it can indirectly mess w/