Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/166754
Change subject: Fix bypassing hooks in TextContentTest
......................................................................
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
---
M tests/phpunit/includes/content/TextContentTest.php
1 file changed, 1 insertion(+), 20 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/54/166754/1
diff --git a/tests/phpunit/includes/content/TextContentTest.php
b/tests/phpunit/includes/content/TextContentTest.php
index 2f81109..dd61f85 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 @@
'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 ) {
--
To view, visit https://gerrit.wikimedia.org/r/166754
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie796f7a53ee38e0dc07f5b026134bbdcb8c9fd53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits