X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fcontent%2FJavaScriptContentTest.php;h=97e0b1c0ec38e57a3cf03e929a8c33293b2d3cb7;hb=029380343e348ee522400315e2edf072cea97ee4;hp=abe352a12f453393a114884b0afe2cea636e0af8;hpb=a85d1b9d0cd7f02111d3a647d5b91e3b1f334563;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index abe352a12f..97e0b1c0ec 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -141,16 +141,6 @@ class JavaScriptContentTest extends TextContentTest { ]; } - /** - * @todo Test needs database! - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - /** * @todo Test needs database! */ @@ -278,10 +268,10 @@ class JavaScriptContentTest extends TextContentTest { ], // @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 ]; } @@ -333,15 +323,30 @@ class JavaScriptContentTest extends TextContentTest { */ 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");' ), - array( 'Gadget:FooBaz.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");' ), + return [ + [ + 'MediaWiki:MonoBook.js', + '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");' + ], + [ + 'User:FooBar/common.js', + '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js\u0026action=raw\u0026ctype=text/javascript");' + ], + [ + 'Gadget:FooBaz.js', + '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");' + ], // No #REDIRECT comment - array( null, 'mw.loader.load("//example.org/w/index.php?title=MediaWiki:NoRedirect.js\u0026action=raw\u0026ctype=text/javascript");' ), + [ + null, + 'mw.loader.load("//example.org/w/index.php?title=MediaWiki:NoRedirect.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");' ), - ); + [ + null, + '/* #REDIRECT */mw.loader.load("//example.com/w/index.php?title=MediaWiki:OtherWiki.js\u0026action=raw\u0026ctype=text/javascript");' + ], + ]; // @codingStandardsIgnoreEnd } }