Go to the documentation of this file.
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',
235 $newContent =
$content->updateRedirect( $target );
237 $this->assertEquals( $expectedText, $newContent->getText() );
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");'
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
processing should stop and the error should be shown to the user * false
ContentHandler Database ^— needed, because we do need the database to test link updates.
testGetRedirectTarget( $title, $text)
JavaScriptContent::getRedirectTarget provideGetRedirectTarget.
Content object for CSS pages.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
namespace and then decline to actually register it file or subcat img or subcat $title
static dataGetParserOutput()
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static provideGetRedirectTarget()
Keep this in sync with JavaScriptContentHandlerTest::provideMakeRedirectContent()
Content for JavaScript pages.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
testGetModel()
JavaScriptContent::getModel.
static dataGetRedirectTarget()
testAddSectionHeader()
JavaScriptContent::addSectionHeader.
testUpdateRedirect( $oldText, $expectedText)
JavaScriptContent::updateRedirect provideUpdateRedirect.
static dataGetTextForSummary()
testGetContentHandler()
JavaScriptContent::getContentHandler.
ContentHandler Database ^— needed, because we do need the database to test link updates.
static dataReplaceSection()
static dataPreloadTransform()
static provideUpdateRedirect()
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
const CONTENT_MODEL_JAVASCRIPT
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
testMatchMagicWord()
JavaScriptContent::matchMagicWord.
static dataPreSaveTransform()