From: Brad Jorsch Date: Thu, 22 Aug 2013 18:38:50 +0000 (-0400) Subject: Clean up parser test's InterwikiLoadPrefix hook X-Git-Tag: 1.31.0-rc.0~18872^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22sites_tous%22%29%20.%20%22?a=commitdiff_plain;h=7b08f602dc986c44a6adf610e663ca11617468b8;p=lhc%2Fweb%2Fwiklou.git 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 --- 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