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]]',
186 [
'#REDIRECT [[bar]]',
191 [
'#REDIRECT [[bar]]',
196 [
'#REDIRECT [[bar]]',
214 [
'[[hello world]].',
230 "should not have matched magic word, since it's not wikitext"
240 'wgServer' =>
'//example.org',
241 'wgScriptPath' =>
'/w',
242 'wgScript' =>
'/w/index.php',
243 'wgResourceBasePath' =>
'/w',
245 $target = Title::newFromText(
"testUpdateRedirect_target" );
248 $newContent =
$content->updateRedirect( $target );
250 $this->assertEquals( $expectedText, $newContent->getNativeData() );
256 '#REDIRECT [[Someplace]]',
257 '#REDIRECT [[Someplace]]',
262 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");',
263 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=TestUpdateRedirect_target\u0026action=raw\u0026ctype=text/javascript");'
301 'wgServer' =>
'//example.org',
302 'wgScriptPath' =>
'/w',
303 'wgScript' =>
'/w/index.php',
304 'wgResourceBasePath' =>
'/w',
307 $target =
$content->getRedirectTarget();
308 $this->assertEquals(
$title, $target ? $target->getPrefixedText() : null );
318 'MediaWiki:MonoBook.js',
319 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");'
322 'User:FooBar/common.js',
323 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=User:FooBar/common.js\u0026action=raw\u0026ctype=text/javascript");'
327 '/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");'
332 'mw.loader.load("//example.org/w/index.php?title=MediaWiki:NoRedirect.js\u0026action=raw\u0026ctype=text/javascript");'
337 '/* #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)
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.
const CONTENT_MODEL_JAVASCRIPT
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
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
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