<?php
+use MediaWiki\MediaWikiServices;
+
/**
* @group ContentHandler
* @group Database
* @covers JavaScriptContent::matchMagicWord
*/
public function testMatchMagicWord() {
- $mw = MagicWord::get( "staticredirect" );
+ $mw = MediaWikiServices::getInstance()->getMagicWordFactory()->get( "staticredirect" );
$content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" );
$this->assertFalse(
$content = new JavaScriptContent( $oldText );
$newContent = $content->updateRedirect( $target );
- $this->assertEquals( $expectedText, $newContent->getNativeData() );
+ $this->assertEquals( $expectedText, $newContent->getText() );
}
public static function provideUpdateRedirect() {
'Gadget:FooBaz.js',
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");'
],
+ // Unicode
+ [
+ 'User:😂/unicode.js',
+ '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:%F0%9F%98%82/unicode.js\u0026action=raw\u0026ctype=text/javascript");'
+ ],
// No #REDIRECT comment
[
null,