From 7b08f602dc986c44a6adf610e663ca11617468b8 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 22 Aug 2013 14:38:50 -0400 Subject: [PATCH] Clean up parser test's InterwikiLoadPrefix hook 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 | 7 +++++++ tests/phpunit/includes/parser/NewParserTest.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index e7c36db0c5..b67ad798f1 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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 ); diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 89103a2558..73c85f001c 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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 -- 2.20.1