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
This commit is contained in:
Timo Tijhof 2020-03-04 02:08:06 +00:00
parent 9ce8f505e5
commit 44dd120f5a

View file

@ -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'
);
}
}