Merge "SpecialMovepage: Convert form to use OOUI controls"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / TextContentTest.php
index 2f81109..fe26375 100644 (file)
@@ -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 ) {