ParserTestRunner: Reset InterwikiLookup service
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 10 Apr 2018 21:05:31 +0000 (17:05 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 10 Apr 2018 21:09:01 +0000 (17:09 -0400)
Otherwise earlier tests might have cached prefixes in the service and
cause these tests to fail.

Change-Id: Id0e6184aff8f9d7e8f32558e1de14faa0168cc1d

tests/parser/ParserTestRunner.php

index 28335ec..844a43f 100644 (file)
@@ -615,9 +615,13 @@ class ParserTestRunner {
                        return false;
                } );// hooks::register
 
+               // Reset the service in case any other tests already cached some prefixes.
+               MediaWikiServices::getInstance()->resetServiceForTesting( 'InterwikiLookup' );
+
                return function () {
                        // Tear down
                        Hooks::clear( 'InterwikiLoadPrefix' );
+                       MediaWikiServices::getInstance()->resetServiceForTesting( 'InterwikiLookup' );
                };
        }