Warn if stateful ParserOutput transforms are used
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / TidyTest.php
index f656a74..62b84aa 100644 (file)
@@ -7,8 +7,7 @@ class TidyTest extends MediaWikiTestCase {
 
        protected function setUp() {
                parent::setUp();
-               $check = MWTidy::tidy( '' );
-               if ( strpos( $check, '<!--' ) !== false ) {
+               if ( !MWTidy::isEnabled() ) {
                        $this->markTestSkipped( 'Tidy not found' );
                }
        }
@@ -44,21 +43,21 @@ class TidyTest extends MediaWikiTestCase {
     </mrow>
   </math>
 MathML;
-               return array(
-                       array(
+               return [
+                       [
                                '<mw:editsection page="foo" section="bar">foo</mw:editsection>',
                                '<mw:editsection page="foo" section="bar">foo</mw:editsection>',
                                '<mw:editsection> should survive tidy'
-                       ),
-                       array(
+                       ],
+                       [
                                '<editsection page="foo" section="bar">foo</editsection>',
                                '<editsection page="foo" section="bar">foo</editsection>',
                                '<editsection> should survive tidy'
-                       ),
-                       array( '<mw:toc>foo</mw:toc>', '<mw:toc>foo</mw:toc>', '<mw:toc> should survive tidy' ),
-                       array( "<link foo=\"bar\" />\nfoo", '<link foo="bar"/>foo', '<link> should survive tidy' ),
-                       array( "<meta foo=\"bar\" />\nfoo", '<meta foo="bar"/>foo', '<meta> should survive tidy' ),
-                       array( $testMathML, $testMathML, '<math> should survive tidy' ),
-               );
+                       ],
+                       [ '<mw:toc>foo</mw:toc>', '<mw:toc>foo</mw:toc>', '<mw:toc> should survive tidy' ],
+                       [ "<link foo=\"bar\" />\nfoo", '<link foo="bar"/>foo', '<link> should survive tidy' ],
+                       [ "<meta foo=\"bar\" />\nfoo", '<meta foo="bar"/>foo', '<meta> should survive tidy' ],
+                       [ $testMathML, $testMathML, '<math> should survive tidy' ],
+               ];
        }
 }