jenkins-bot has submitted this change and it was merged. Change subject: Test Configuration merge edge case ......................................................................
Test Configuration merge edge case Change-Id: Ida4664b0806e2a38f8f863494c6e55e210c68959 --- M Tests/ConfigurationTest.php 1 file changed, 34 insertions(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/Tests/ConfigurationTest.php b/Tests/ConfigurationTest.php index 4cace76..1044a2e 100644 --- a/Tests/ConfigurationTest.php +++ b/Tests/ConfigurationTest.php @@ -18,4 +18,38 @@ $this->assertEquals( 'FOO', $config->val( 'logging/root-context' ), 'Config was overridden.' ); } + + /** + * Check that sparsely populated deep structures override one another + * additively, and we don't lose branches from half of the union. + * TODO: Provide more cases using a dataProvider. + */ + public function testOverrideDeep() { + $config = $this->setConfig(); + + $config->override( array( + 'endpoints' => array( + 'listener' => array( + 'class' => 'SmashPig\Ham', + 'postback-url' => 'http://Salad', + ), + ), + ) ); + + $config->override( array( + 'endpoints' => array( + 'listener' => array( + 'postback-url' => 'http://Rice', + ), + ), + ) ); + + $expected = array( + 'class' => 'SmashPig\Ham', + 'postback-url' => 'http://Rice', + ); + + $this->assertEquals( $expected, $config->val( 'endpoints/listener' ), + 'Deep merge went as hoped' ); + } } -- To view, visit https://gerrit.wikimedia.org/r/311886 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida4664b0806e2a38f8f863494c6e55e210c68959 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org> Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits