Enable email settings for ApiBlockTest::testBlockWithEmailBlock
[lhc/web/wiklou.git] / tests / phpunit / includes / MessageTest.php
index 70f4af9..e745960 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 
-use Wikimedia\ObjectFactory;
 use Wikimedia\TestingAccessWrapper;
 
 /**
@@ -26,7 +25,7 @@ class MessageTest extends MediaWikiLangTestCase {
 
                $this->assertSame( $key, $message->getKey() );
                $this->assertSame( $params, $message->getParams() );
-               $this->assertEquals( $expectedLang, $message->getLanguage() );
+               $this->assertSame( $expectedLang->getCode(), $message->getLanguage()->getCode() );
 
                $messageSpecifier = $this->getMockForAbstractClass( MessageSpecifier::class );
                $messageSpecifier->expects( $this->any() )
@@ -37,7 +36,7 @@ class MessageTest extends MediaWikiLangTestCase {
 
                $this->assertSame( $key, $message->getKey() );
                $this->assertSame( $params, $message->getParams() );
-               $this->assertEquals( $expectedLang, $message->getLanguage() );
+               $this->assertSame( $expectedLang->getCode(), $message->getLanguage()->getCode() );
        }
 
        public static function provideConstructor() {
@@ -400,15 +399,15 @@ class MessageTest extends MediaWikiLangTestCase {
                $this->assertSame( 'example &amp;', $msg->escaped() );
        }
 
+       /**
+        * @covers CoreTagHooks::html
+        */
        public function testRawHtmlInMsg() {
-               global $wgParserConf;
                $this->setMwGlobals( 'wgRawHtml', true );
                // We have to reset the core hook registration.
                // to register the html hook
                MessageCache::destroyInstance();
-               $this->setMwGlobals( 'wgParser',
-                       ObjectFactory::constructClassInstance( $wgParserConf['class'], [ $wgParserConf ] )
-               );
+               $this->overrideMwServices();
 
                $msg = new RawMessage( '<html><script>alert("xss")</script></html>' );
                $txt = '<span class="error">&lt;html&gt; tags cannot be' .