diff options
Diffstat (limited to 'tests/phpunit/includes/content/JavaScriptContentHandlerTest.php')
-rw-r--r-- | tests/phpunit/includes/content/JavaScriptContentHandlerTest.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/phpunit/includes/content/JavaScriptContentHandlerTest.php b/tests/phpunit/includes/content/JavaScriptContentHandlerTest.php index 7e257da65291..a71b08f28b95 100644 --- a/tests/phpunit/includes/content/JavaScriptContentHandlerTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentHandlerTest.php @@ -5,11 +5,13 @@ use MediaWiki\Content\JavaScriptContentHandler; use MediaWiki\MainConfigNames; use MediaWiki\Title\Title; +/** + * @covers \JavaScriptContentHandler + */ class JavaScriptContentHandlerTest extends MediaWikiLangTestCase { /** * @dataProvider provideMakeRedirectContent - * @covers \MediaWiki\Content\JavaScriptContentHandler::makeRedirectContent */ public function testMakeRedirectContent( $title, $expected ) { $this->overrideConfigValues( [ @@ -23,31 +25,30 @@ class JavaScriptContentHandlerTest extends MediaWikiLangTestCase { } /** - * Keep this in sync with JavaScriptContentTest::provideGetRedirectTarget() + * This is re-used by JavaScriptContentTest to assert roundtrip */ public static function provideMakeRedirectContent() { return [ - [ + 'MediaWiki namespace page' => [ 'MediaWiki:MonoBook.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js&action=raw&ctype=text/javascript");' ], - [ + 'User subpage' => [ 'User:FooBar/common.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js&action=raw&ctype=text/javascript");' ], - [ + 'Gadget page' => [ 'Gadget:FooBaz.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js&action=raw&ctype=text/javascript");' ], - [ + 'Unicode basename' => [ 'User:😂/unicode.js', '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:%F0%9F%98%82/unicode.js&action=raw&ctype=text/javascript");' ], - [ - 'User:A&B/ampersand.js', - '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:A%26B/ampersand.js&action=raw&ctype=text/javascript");' + 'Ampersand basename' => [ + 'User:Penn & Teller/ampersand.js', + '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:Penn_%26_Teller/ampersand.js&action=raw&ctype=text/javascript");' ], ]; - // phpcs:enable } } |