From 44dd120f5adb5b58400f74bebadf96e46b4c0d4c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 4 Mar 2020 02:08:06 +0000 Subject: [PATCH] SiteConfiguration: Add unit test for tag/suffix conflict scenario This is currently broken per T246858. Will be fixed in the next commit. Bug: T246858 Change-Id: Ifb5239e118f8707ccc397d55e4ae3eb8287906a3 --- .../unit/includes/SiteConfigurationTest.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/phpunit/unit/includes/SiteConfigurationTest.php b/tests/phpunit/unit/includes/SiteConfigurationTest.php index a95d3bb7663..8cdfdb56157 100644 --- a/tests/phpunit/unit/includes/SiteConfigurationTest.php +++ b/tests/phpunit/unit/includes/SiteConfigurationTest.php @@ -408,4 +408,27 @@ class SiteConfigurationTest extends \MediaWikiUnitTestCase { 'extractAllGlobals(): merging setting' ); } + + /** + * @covers SiteConfiguration + */ + public function testSuffixAndTagConflict() { + $conf = new SiteConfiguration; + + $conf->suffixes = [ 'foo', 'bar', 'baz' ]; + $conf->wikis = [ 'aabar', 'bbbar', 'ccbar' ]; + $conf->settings = [ + 'MyVariable' => [ + 'default' => [ 'x' ], + '+bar' => [ 'y' ], + ], + ]; + + $this->assertSame( + // FIXME: This is broken (T246858) + [ 'y', 'y', 'x' ], + $conf->get( 'MyVariable', 'bbbar', 'bar', [], [ 'alpha', 'bar' ] ), + 'get(): variable with +merge for a tag that is also a suffix' + ); + } }