20 "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello <world>\n\n</pre>"
25 "hello(); // [[world]]\n",
26 "<pre class=\"mw-code mw-js\" dir=\"ltr\">\nhello(); // [[world]]\n\n</pre>",
73 "== TEST ==\nmore fun",
97 $c = $content->addSectionHeader(
'test' );
99 $this->assertTrue( $content->equals( $c ) );
105 [
'hello this is ~~~',
106 "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
108 [
'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
109 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
124 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
125 'hello \'\'this\'\' is <noinclude>foo</noinclude><includeonly>bar</includeonly>',
132 [
'#REDIRECT [[Test]]',
138 [
'* #REDIRECT [[Test]]',
176 [
'#REDIRECT [[bar]]',
181 [
'#REDIRECT [[bar]]',
199 [
'[[hello world]].',
212 $content = $this->
newContent(
"#REDIRECT [[FOO]]\n__STATICREDIRECT__" );
214 $content->matchMagicWord( $mw ),
215 "should not have matched magic word, since it's not wikitext"
225 'wgServer' =>
'//example.org',
226 'wgScriptPath' =>
'/w',
227 'wgScript' =>
'/w/index.php',
228 'wgResourceBasePath' =>
'/w',
230 $target = Title::newFromText(
"testUpdateRedirect_target" );
233 $newContent = $content->updateRedirect( $target );
235 $this->assertEquals( $expectedText, $newContent->getNativeData() );
242 '#REDIRECT [[Someplace]]',
243 '#REDIRECT [[Someplace]]',
246 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");',
247 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=TestUpdateRedirect_target\u0026action=raw\u0026ctype=text/javascript");'
257 $content = $this->
newContent(
"hello world." );
266 $content = $this->
newContent(
"hello world." );
286 'wgServer' =>
'//example.org',
287 'wgScriptPath' =>
'/w',
288 'wgScript' =>
'/w/index.php',
289 'wgResourceBasePath' =>
'/w',
292 $target = $content->getRedirectTarget();
293 $this->assertEquals( $title, $target ? $target->getPrefixedText() : null );
303 'MediaWiki:MonoBook.js',
304 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");'
307 'User:FooBar/common.js',
308 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js\u0026action=raw\u0026ctype=text/javascript");'
312 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");'
317 'mw.loader.load("//example.org/w/index.php?title=MediaWiki:NoRedirect.js\u0026action=raw\u0026ctype=text/javascript");'
322 '/* #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.
static & get( $id)
Factory: creates an object representing an ID.
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