Merge "ChangesList: HTML escape the timestamp"
[lhc/web/wiklou.git] / tests / phpunit / includes / ExtraParserTest.php
index aaa135d..94de088 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Parser-related tests that don't suit for parserTests.txt
  *
@@ -17,7 +19,7 @@ class ExtraParserTest extends MediaWikiTestCase {
 
                $contLang = Language::factory( 'en' );
                $this->setMwGlobals( [
-                       'wgShowDBErrorBacktrace' => true,
+                       'wgShowExceptionDetails' => true,
                        'wgCleanSignatures' => true,
                ] );
                $this->setUserLang( 'en' );
@@ -26,10 +28,9 @@ class ExtraParserTest extends MediaWikiTestCase {
                // FIXME: This test should pass without setting global content language
                $this->options = ParserOptions::newFromUserAndLang( new User, $contLang );
                $this->options->setTemplateCallback( [ __CLASS__, 'statelessFetchTemplate' ] );
-               $this->options->setWrapOutputClass( false );
                $this->parser = new Parser;
 
-               MagicWord::clearCache();
+               MediaWikiServices::getInstance()->resetServiceForTesting( 'MagicWordFactory' );
        }
 
        /**
@@ -41,9 +42,8 @@ class ExtraParserTest extends MediaWikiTestCase {
 
                $title = Title::newFromText( 'Unit test' );
                $options = ParserOptions::newFromUser( new User() );
-               $options->setWrapOutputClass( false );
                $this->assertEquals( "<p>$longLine</p>",
-                       $this->parser->parse( $longLine, $title, $options )->getText() );
+                       $this->parser->parse( $longLine, $title, $options )->getText( [ 'unwrap' => true ] ) );
        }
 
        /**
@@ -55,7 +55,7 @@ class ExtraParserTest extends MediaWikiTestCase {
                $parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options );
                $this->assertEquals(
                        "<p>Test\nContent of <i>Template:Foo</i>\nContent of <i>Template:Bar</i>\n</p>",
-                       $parserOutput->getText()
+                       $parserOutput->getText( [ 'unwrap' => true ] )
                );
        }