X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fcontent%2FTextContentTest.php;h=06609d8fe53d9a2d29e3a4f6d02f90f29dc8da81;hb=88081365b3604e51922151bb2de3185f6f8b5896;hp=2f8110945e67941f0aabb72cd35062e923018e0b;hpb=358f2a07c63a5965a519d5932dc200a895cd8c61;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index 2f8110945e..06609d8fe5 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 @@ -30,26 +27,16 @@ class TextContentTest extends MediaWikiLangTestCase { CONTENT_MODEL_JAVASCRIPT, ), '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'] ); - } + MWTidy::destroySingleton(); } - public function teardown() { - global $wgHooks; - - // restore hooks that force custom rendering - if ( $this->savedContentGetParserOutput !== null ) { - $wgHooks['ContentGetParserOutput'] = $this->savedContentGetParserOutput; - } - - parent::teardown(); + protected function tearDown() { + MWTidy::destroySingleton(); + parent::tearDown(); } public function newContent( $text ) { @@ -106,12 +93,12 @@ class TextContentTest extends MediaWikiLangTestCase { public static function dataPreSaveTransform() { return array( array( - #0: no signature resolution + # 0: no signature resolution 'hello this is ~~~', 'hello this is ~~~', ), array( - #1: rtrim + # 1: rtrim " Foo \n ", ' Foo', ), @@ -434,7 +421,7 @@ class TextContentTest extends MediaWikiLangTestCase { $update = $updates[$class]; foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn + $v = $update->$field; # if the field doesn't exist, just crash and burn $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); } }