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-18 12:53:20 +0300
committerdiosmosis <benaka@piwik.pro>2015-06-20 03:09:13 +0300
commitf4c1879065133ea1821a6ed582b8677f3981acd2 (patch)
treeb60ced418edffc39709a6e6fbcc89744af82ebd2 /tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
parent49311eb3482c4e0e3811e104507da68ee963678c (diff)
When getting fixture and test case configs to override in tests, do not use array_merge, instead just add them to the array of definition arrays.
Diffstat (limited to 'tests/PHPUnit/Framework/TestingEnvironmentManipulator.php')
-rw-r--r--tests/PHPUnit/Framework/TestingEnvironmentManipulator.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php b/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
index d26c1576b9..5da8741e88 100644
--- a/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
+++ b/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
@@ -135,7 +135,7 @@ class TestingEnvironmentManipulator implements EnvironmentManipulator
{
$testVarDefinitionSource = new TestingEnvironmentVariablesDefinitionSource($this->vars);
- $diConfig = array();
+ $diConfigs = array($testVarDefinitionSource);
if ($this->vars->testCaseClass) {
$testCaseClass = $this->vars->testCaseClass;
if (class_exists($testCaseClass)) {
@@ -143,24 +143,22 @@ class TestingEnvironmentManipulator implements EnvironmentManipulator
// Apply DI config from the fixture
if (isset($testCaseClass::$fixture)) {
- $diConfig = array_merge($diConfig, $testCaseClass::$fixture->provideContainerConfig());
+ $diConfigs[] = $testCaseClass::$fixture->provideContainerConfig();
}
if (method_exists($testCase, 'provideContainerConfigBeforeClass')) {
- $diConfig = array_merge($diConfig, $testCaseClass::provideContainerConfigBeforeClass());
+ $diConfigs[] = $testCaseClass::provideContainerConfigBeforeClass();
}
if (method_exists($testCase, 'provideContainerConfig')) {
- $diConfig = array_merge($diConfig, $testCase->provideContainerConfig());
+ $diConfigs[] = $testCase->provideContainerConfig();
}
}
}
- return array(
- $testVarDefinitionSource,
- $diConfig,
- array('observers.global' => \DI\add($this->globalObservers)),
- );
+ $diConfigs[] = array('observers.global' => \DI\add($this->globalObservers));
+
+ return $diConfigs;
}
public function getExtraEnvironments()