ParserTest: clear Language namespaces cache
authorAntoine Musso <hashar@free.fr>
Sun, 25 Mar 2018 13:34:05 +0000 (15:34 +0200)
committerAntoine Musso <hashar@free.fr>
Sun, 25 Mar 2018 13:36:10 +0000 (15:36 +0200)
The content language object has a cache for namespaces, it might then
not take in account $wgExtraNamespaces set by the parser test suite
which causes unknown namespaces errors.

Ensure the new language object has a clean cache.

Repro:
php phpunit.php --filter '(ParserMethodsTest::testValidCovers|T53680)'

Bug: T190554
Change-Id: I9c4104d7bb3a0c84b60d7e7b4154743cbe58348c

tests/parser/ParserTestRunner.php

index f0c815f..28335ec 100644 (file)
@@ -1108,6 +1108,7 @@ class ParserTestRunner {
 
                // Set content language. This invalidates the magic word cache and title services
                $lang = Language::factory( $langCode );
+               $lang->resetNamespaces();
                $setup['wgContLang'] = $lang;
                $reset = function () {
                        MagicWord::clearCache();