public static function dataPreloadTransform() {
return array(
- array( 'hello this is ~~~',
+ array(
+ 'hello this is ~~~',
'hello this is ~~~',
),
- array( 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
+ array(
+ 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
),
);
public function testUpdateRedirect( $oldText, $expectedText ) {
$this->setMwGlobals( array(
'wgServer' => '//example.org',
- 'wgScriptPath' => '/w/index.php',
+ 'wgScriptPath' => '/w',
+ 'wgScript' => '/w/index.php',
+ 'wgResourceBasePath' => '/w',
) );
$target = Title::newFromText( "testUpdateRedirect_target" );
'#REDIRECT [[Someplace]]',
'#REDIRECT [[Someplace]]',
),
+
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
array(
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");',
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=TestUpdateRedirect_target\u0026action=raw\u0026ctype=text/javascript");'
)
+ // @codingStandardsIgnoreEnd
);
}
public function testGetRedirectTarget( $title, $text ) {
$this->setMwGlobals( array(
'wgServer' => '//example.org',
- 'wgScriptPath' => '/w/index.php',
+ 'wgScriptPath' => '/w',
+ 'wgScript' => '/w/index.php',
+ 'wgResourceBasePath' => '/w',
) );
$content = new JavaScriptContent( $text );
$target = $content->getRedirectTarget();
* Keep this in sync with JavaScriptContentHandlerTest::provideMakeRedirectContent()
*/
public static function provideGetRedirectTarget() {
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
return array(
array( 'MediaWiki:MonoBook.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");' ),
array( 'User:FooBar/common.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js\u0026action=raw\u0026ctype=text/javascript");' ),
// Different domain
array( null, '/* #REDIRECT */mw.loader.load("//example.com/w/index.php?title=MediaWiki:OtherWiki.js\u0026action=raw\u0026ctype=text/javascript");' ),
);
+ // @codingStandardsIgnoreEnd
}
}