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
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2020-01-27 01:19:46 +0300
committerGitHub <noreply@github.com>2020-01-27 01:19:46 +0300
commitd6d79352f915864a3b7cee9ecc300baac1efc8c9 (patch)
tree86ca751c1a01e645437db2af811f720dbf62fed9 /tests
parent74414c934c1f3fd0309efa6eedad70d947f622d8 (diff)
Forward instance_id from local config when reseting config during tests. (#15445)
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Framework/Mock/TestConfig.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/PHPUnit/Framework/Mock/TestConfig.php b/tests/PHPUnit/Framework/Mock/TestConfig.php
index 027499aae5..06e836c864 100644
--- a/tests/PHPUnit/Framework/Mock/TestConfig.php
+++ b/tests/PHPUnit/Framework/Mock/TestConfig.php
@@ -58,9 +58,18 @@ class TestConfig extends Config
// Ensure local mods do not affect tests
if (empty($pathGlobal)) {
+ $general = $chain->getFrom($this->getLocalPath(), 'General');
+ $instanceId = isset($general['instance_id']) ? $general['instance_id'] : null;
+
$chain->set('Debug', $chain->getFrom($this->getGlobalPath(), 'Debug'));
$chain->set('mail', $chain->getFrom($this->getGlobalPath(), 'mail'));
- $chain->set('General', $chain->getFrom($this->getGlobalPath(), 'General'));
+
+ $globalGeneral = $chain->getFrom($this->getGlobalPath(), 'General');
+ if ($instanceId) {
+ $globalGeneral['instance_id'] = $instanceId;
+ }
+ $chain->set('General', $globalGeneral);
+
$chain->set('Segments', $chain->getFrom($this->getGlobalPath(), 'Segments'));
$chain->set('Tracker', $chain->getFrom($this->getGlobalPath(), 'Tracker'));
$chain->set('Deletelogs', $chain->getFrom($this->getGlobalPath(), 'Deletelogs'));