From cb82a1d798e4ebe3f82b24c42edf387d517022eb Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 15 Oct 2014 17:09:30 +0200 Subject: [PATCH] Fix bypassing hooks in TextContentTest Save the whole global $wgHooks with the default way instead of just a hook in a own variable. Change-Id: Ie796f7a53ee38e0dc07f5b026134bbdcb8c9fd53 --- .../includes/content/TextContentTest.php | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index 2f8110945e..dd61f85b4e 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -7,11 +7,8 @@ */ class TextContentTest extends MediaWikiLangTestCase { protected $context; - protected $savedContentGetParserOutput; protected function setUp() { - global $wgHooks; - parent::setUp(); // Anon user @@ -32,24 +29,8 @@ class TextContentTest extends MediaWikiLangTestCase { 'wgUseTidy' => false, 'wgAlwaysUseTidy' => false, 'wgCapitalLinks' => true, + 'wgHooks' => array(), // bypass hook ContentGetParserOutput that force custom rendering ) ); - - // bypass hooks that force custom rendering - if ( isset( $wgHooks['ContentGetParserOutput'] ) ) { - $this->savedContentGetParserOutput = $wgHooks['ContentGetParserOutput']; - unset( $wgHooks['ContentGetParserOutput'] ); - } - } - - public function teardown() { - global $wgHooks; - - // restore hooks that force custom rendering - if ( $this->savedContentGetParserOutput !== null ) { - $wgHooks['ContentGetParserOutput'] = $this->savedContentGetParserOutput; - } - - parent::teardown(); } public function newContent( $text ) { -- 2.20.1