22 "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello <world>\n\n</pre>"
27 "hello(); // [[world]]\n",
28 "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello(); // [[world]]\n\n</pre>",
75 "== TEST ==\nmore fun",
99 $c =
$content->addSectionHeader(
'test' );
101 $this->assertTrue(
$content->equals( $c ) );
107 [
'hello this is ~~~',
108 "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
110 [
'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
111 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
126 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
127 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
134 [
'#REDIRECT [[Test]]',
140 [
'* #REDIRECT [[Test]]',
178 [
'#REDIRECT [[bar]]',
183 [
'#REDIRECT [[bar]]',
201 [
'[[hello world]].',
212 $mw = MediaWikiServices::getInstance()->getMagicWordFactory()->get(
"staticredirect" );
217 "should not have matched magic word, since it's not wikitext"
227 'wgServer' =>
'//example.org',
228 'wgScriptPath' =>
'/w',
229 'wgScript' =>
'/w/index.php',
230 'wgResourceBasePath' =>
'/w',
232 $target = Title::newFromText(
"testUpdateRedirect_target" );
235 $newContent =
$content->updateRedirect( $target );
237 $this->assertEquals( $expectedText, $newContent->getNativeData() );
244 '#REDIRECT [[Someplace]]',
245 '#REDIRECT [[Someplace]]',
248 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");',
249 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=TestUpdateRedirect_target\u0026action=raw\u0026ctype=text/javascript");'
288 'wgServer' =>
'//example.org',
289 'wgScriptPath' =>
'/w',
290 'wgScript' =>
'/w/index.php',
291 'wgResourceBasePath' =>
'/w',
294 $target =
$content->getRedirectTarget();
295 $this->assertEquals( $title, $target ? $target->getPrefixedText() : null );
305 'MediaWiki:MonoBook.js',
306 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");'
309 'User:FooBar/common.js',
310 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js\u0026action=raw\u0026ctype=text/javascript");'
314 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");'
318 'User:😂/unicode.js',
319 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:%F0%9F%98%82/unicode.js\u0026action=raw\u0026ctype=text/javascript");'
324 'mw.loader.load("//example.org/w/index.php?title=MediaWiki:NoRedirect.js\u0026action=raw\u0026ctype=text/javascript");'
329 '/* #REDIRECT */mw.loader.load("//example.com/w/index.php?title=MediaWiki:OtherWiki.js\u0026action=raw\u0026ctype=text/javascript");'
Content object for CSS pages.
ContentHandler Database ^— needed, because we do need the database to test link updates.
testMatchMagicWord()
JavaScriptContent::matchMagicWord.
testGetModel()
JavaScriptContent::getModel.
static dataGetRedirectTarget()
testUpdateRedirect( $oldText, $expectedText)
JavaScriptContent::updateRedirect provideUpdateRedirect.
static dataPreSaveTransform()
testGetContentHandler()
JavaScriptContent::getContentHandler.
testGetRedirectTarget( $title, $text)
JavaScriptContent::getRedirectTarget provideGetRedirectTarget.
static provideGetRedirectTarget()
Keep this in sync with JavaScriptContentHandlerTest::provideMakeRedirectContent()
static dataGetTextForSummary()
static dataGetParserOutput()
static dataPreloadTransform()
static provideUpdateRedirect()
testAddSectionHeader()
JavaScriptContent::addSectionHeader.
static dataReplaceSection()
Content for JavaScript pages.
ContentHandler Database ^— needed, because we do need the database to test link updates.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
processing should stop and the error should be shown to the user * false
const CONTENT_MODEL_JAVASCRIPT