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:
-rw-r--r--tests/PHPUnit/Framework/Fixture.php16
-rwxr-xr-xtests/PHPUnit/Framework/TestCase/SystemTestCase.php5
2 files changed, 13 insertions, 8 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 4cb80ad022..f25e6f4c2d 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -116,6 +116,8 @@ class Fixture extends \PHPUnit_Framework_Assert
*/
public $extraDefinitions = array();
+ public $extraTestEnvVars = array();
+
/**
* @var Environment
*/
@@ -188,10 +190,16 @@ class Fixture extends \PHPUnit_Framework_Assert
$this->removeExistingSuperUser = false;
}
- $this->getTestEnvironment()->testCaseClass = $this->testCaseClass;
- $this->getTestEnvironment()->fixtureClass = get_class($this);
- $this->getTestEnvironment()->dbName = $this->dbName;
- $this->getTestEnvironment()->save();
+ $testEnv = $this->getTestEnvironment();
+ $testEnv->testCaseClass = $this->testCaseClass;
+ $testEnv->fixtureClass = get_class($this);
+ $testEnv->dbName = $this->dbName;
+
+ foreach ($this->extraTestEnvVars as $name => $value) {
+ $testEnv->$name = $value;
+ }
+
+ $testEnv->save();
$this->createEnvironmentInstance();
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
index 9d87b1a45d..b7c3929815 100755
--- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
@@ -64,10 +64,7 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase
}
$fixture->testCaseClass = get_called_class();
- $fixture->extraDefinitions = array_merge(
- array('test.vars.loadRealTranslations' => true), // load real translations for system tests
- $fixture->extraDefinitions
- );
+ $fixture->extraTestEnvVars['loadRealTranslations'] = true; // load real translations for system tests
try {
$fixture->performSetUp();