Clean up parser test's InterwikiLoadPrefix hook
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 22 Aug 2013 18:38:50 +0000 (14:38 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 22 Aug 2013 18:42:45 +0000 (14:42 -0400)
Change I36865e38 adjusted the parser test class to hook
InterwikiLoadPrefix, and prevent any other uses of that hook. Which is
ok, except it doesn't clean up after itself so it winds up breaking any
other parser tests that use the same hook.

Change-Id: I351a56ac39a44721d427e9c980eaf5fff246fb57

tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php

index e7c36db..b67ad79 100644 (file)
@@ -269,6 +269,13 @@ class ParserTest {
                } );// hooks::register
        }
 
+       /**
+        * Remove the hardcoded interwiki lookup table.
+        */
+       public static function tearDownInterwikis() {
+               Hooks::clear( 'InterwikiLoadPrefix' );
+       }
+
        public function setupRecorder( $options ) {
                if ( isset( $options['record'] ) ) {
                        $this->recorder = new DbTestRecorder( $this );
index 89103a2..73c85f0 100644 (file)
@@ -161,6 +161,11 @@ class NewParserTest extends MediaWikiTestCase {
                parent::tearDown();
        }
 
+       public static function tearDownAfterClass() {
+               ParserTest::tearDownInterwikis();
+               parent::tearDownAfterClass();
+       }
+
        function addDBData() {
                $this->tablesUsed[] = 'site_stats';
                # disabled for performance