<?php
-use Wikimedia\ObjectFactory;
+use MediaWiki\MediaWikiServices;
use Wikimedia\TestingAccessWrapper;
/**
$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() )
$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() {
}
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 ] )
- );
+ MediaWikiServices::getInstance()->getParserFactory()->create() );
$msg = new RawMessage( '<html><script>alert("xss")</script></html>' );
$txt = '<span class="error"><html> tags cannot be' .