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:
authordiosmosis <benaka@piwik.pro>2015-06-06 00:31:42 +0300
committerdiosmosis <benaka@piwik.pro>2015-06-06 00:35:46 +0300
commit28329746406b75bc1b54ee598a915b85b03655ad (patch)
tree45c22c606d63eea1b1393d7482a55773a70b3622 /tests/PHPUnit/bootstrap.php
parentaff138ab0347002774f3beafb2b77fe2880d9526 (diff)
Allow multiple environments to be specified to Environment constructor. Add hook in EnvironmentManipulator to get extra environment names, and specify test environment this way instead of through detecting PIWIK_TEST_MODE.
Diffstat (limited to 'tests/PHPUnit/bootstrap.php')
-rw-r--r--tests/PHPUnit/bootstrap.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index 01dda0ec0d..661b37ab38 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -1,10 +1,13 @@
<?php
+use Piwik\Application\Environment;
use Piwik\Container\StaticContainer;
use Piwik\Http;
use Piwik\Intl\Locale;
use Piwik\Config;
use Piwik\SettingsPiwik;
+use Piwik\Tests\Framework\TestingEnvironmentManipulator;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
define('PIWIK_TEST_MODE', true);
define('PIWIK_PRINT_ERROR_BACKTRACE', false);
@@ -43,6 +46,8 @@ if (getenv('PIWIK_USE_XHPROF') == 1) {
// setup container for tests
function setupRootContainer() {
+ Environment::setGlobalEnvironmentManipulator(new TestingEnvironmentManipulator(new TestingEnvironmentVariables()));
+
$rootTestEnvironment = new \Piwik\Application\Environment(null);
$rootTestEnvironment->init();
}