Go to the documentation of this file.
21 12303 =>
'TEST-JS_TALK',
26 'wgNamespaceContentModels',
35 [
'Main Page',
'Main Page',
true ],
36 [
'Main Page',
'Not The Main Page',
false ],
37 [
'Main Page',
'Project:Main Page',
false ],
38 [
'File:Example.png',
'Image:Example.png',
true ],
39 [
'Special:Version',
'Special:Version',
true ],
40 [
'Special:Version',
'Special:Recentchanges',
false ],
41 [
'Special:Version',
'Main Page',
false ],
49 public function testEquals( $titleA, $titleB, $expectedBool ) {
53 $this->assertEquals( $expectedBool, $titleA->equals( $titleB ) );
54 $this->assertEquals( $expectedBool, $titleB->equals( $titleA ) );
76 $this->assertEquals( $expectedBool,
$title->inNamespace( $ns ) );
85 $this->assertTrue( $mainpage->inNamespaces( [
NS_MAIN,
NS_USER ] ) );
86 $this->assertTrue( $mainpage->inNamespaces( [
NS_USER,
NS_MAIN ] ) );
109 $this->assertEquals( $expectedBool,
$title->hasSubjectNamespace( $ns ) );
143 $this->assertEquals( $expectedModelId,
$title->getContentModel() );
152 $this->assertTrue(
$title->hasContentModel( $expectedModelId ) );
157 [
'Help:Foo',
false ],
158 [
'Help:Foo.js',
false ],
159 [
'Help:Foo/bar.js',
false ],
160 [
'User:Foo',
false ],
161 [
'User:Foo.js',
false ],
162 [
'User:Foo/bar.js',
false ],
163 [
'User:Foo/bar.json',
false ],
164 [
'User:Foo/bar.css',
false ],
165 [
'User:Foo/bar.JS',
false ],
166 [
'User:Foo/bar.JSON',
false ],
167 [
'User:Foo/bar.CSS',
false ],
168 [
'User talk:Foo/bar.css',
false ],
169 [
'User:Foo/bar.js.xxx',
false ],
170 [
'User:Foo/bar.xxx',
false ],
171 [
'MediaWiki:Foo.js',
true ],
172 [
'MediaWiki:Foo.json',
true ],
173 [
'MediaWiki:Foo.css',
true ],
174 [
'MediaWiki:Foo.JS',
false ],
175 [
'MediaWiki:Foo.JSON',
false ],
176 [
'MediaWiki:Foo.CSS',
false ],
177 [
'MediaWiki:Foo/bar.css',
true ],
178 [
'MediaWiki:Foo.css.xxx',
false ],
179 [
'TEST-JS:Foo',
false ],
180 [
'TEST-JS:Foo.js',
false ],
190 $this->assertEquals( $expectedBool,
$title->isSiteConfigPage() );
195 [
'Help:Foo',
false ],
196 [
'Help:Foo.js',
false ],
197 [
'Help:Foo/bar.js',
false ],
198 [
'User:Foo',
false ],
199 [
'User:Foo.js',
false ],
200 [
'User:Foo/bar.js',
true ],
201 [
'User:Foo/bar.JS',
false ],
202 [
'User:Foo/bar.json',
true ],
203 [
'User:Foo/bar.JSON',
false ],
204 [
'User:Foo/bar.css',
true ],
205 [
'User:Foo/bar.CSS',
false ],
206 [
'User talk:Foo/bar.css',
false ],
207 [
'User:Foo/bar.js.xxx',
false ],
208 [
'User:Foo/bar.xxx',
false ],
209 [
'MediaWiki:Foo.js',
false ],
210 [
'MediaWiki:Foo.json',
false ],
211 [
'MediaWiki:Foo.css',
false ],
212 [
'MediaWiki:Foo.JS',
false ],
213 [
'MediaWiki:Foo.JSON',
false ],
214 [
'MediaWiki:Foo.CSS',
false ],
215 [
'MediaWiki:Foo.css.xxx',
false ],
216 [
'TEST-JS:Foo',
false ],
217 [
'TEST-JS:Foo.js',
false ],
227 $this->assertEquals( $expectedBool,
$title->isUserConfigPage() );
232 [
'Help:Foo',
false ],
233 [
'Help:Foo.css',
false ],
234 [
'User:Foo',
false ],
235 [
'User:Foo.js',
false ],
236 [
'User:Foo.json',
false ],
237 [
'User:Foo.css',
false ],
238 [
'User:Foo/bar.js',
false ],
239 [
'User:Foo/bar.json',
false ],
240 [
'User:Foo/bar.css',
true ],
250 $this->assertEquals( $expectedBool,
$title->isUserCssConfigPage() );
255 [
'Help:Foo',
false ],
256 [
'Help:Foo.css',
false ],
257 [
'User:Foo',
false ],
258 [
'User:Foo.js',
false ],
259 [
'User:Foo.json',
false ],
260 [
'User:Foo.css',
false ],
261 [
'User:Foo/bar.js',
true ],
262 [
'User:Foo/bar.json',
false ],
263 [
'User:Foo/bar.css',
false ],
273 $this->assertEquals( $expectedBool,
$title->isUserJsConfigPage() );
278 [
'Help:Foo',
true ],
279 [
'Help:Foo.js',
true ],
280 [
'Help:Foo/bar.js',
true ],
281 [
'User:Foo',
true ],
282 [
'User:Foo.js',
true ],
283 [
'User:Foo/bar.js',
false ],
284 [
'User:Foo/bar.json',
false ],
285 [
'User:Foo/bar.css',
false ],
286 [
'User talk:Foo/bar.css',
true ],
287 [
'User:Foo/bar.js.xxx',
true ],
288 [
'User:Foo/bar.xxx',
true ],
289 [
'MediaWiki:Foo.js',
false ],
290 [
'User:Foo/bar.JS',
true ],
291 [
'User:Foo/bar.JSON',
true ],
292 [
'User:Foo/bar.CSS',
true ],
293 [
'MediaWiki:Foo.json',
false ],
294 [
'MediaWiki:Foo.css',
false ],
295 [
'MediaWiki:Foo.JS',
true ],
296 [
'MediaWiki:Foo.JSON',
true ],
297 [
'MediaWiki:Foo.CSS',
true ],
298 [
'MediaWiki:Foo.css.xxx',
true ],
299 [
'TEST-JS:Foo',
false ],
300 [
'TEST-JS:Foo.js',
false ],
310 $this->assertEquals( $expectedBool,
$title->isWikitextPage() );
315 [
'Main Page',
'Talk:Main Page' ],
316 [
'Talk:Main Page',
'Main Page' ],
317 [
'Help:Main Page',
'Help talk:Main Page' ],
318 [
'Help talk:Main Page',
'Help:Main Page' ],
319 [
'Special:FooBar', null ],
320 [
'Media:File.jpg', null ],
332 if ( $expected ===
null ) {
337 $this->assertEquals( $expected,
$title->getOtherPage()->getPrefixedText() );
344 $linkCache = MediaWikiServices::getInstance()->getLinkCache();
347 $linkCache->addGoodLinkObj( 23, $title1 );
352 $this->assertNotSame( $title1, $title2,
'title cache should be empty' );
353 $this->assertEquals( 0, $linkCache->getGoodLinkID(
'Foo' ),
'link cache should be empty' );
testHasSubjectNamespace( $title, $ns, $expectedBool)
provideHasSubjectNamespace Title::hasSubjectNamespace
testClearCaches()
Title::clearCaches.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
testEquals( $titleA, $titleB, $expectedBool)
provideEquals Title::equals
static provideGetOtherPage()
processing should stop and the error should be shown to the user * false
static provideIsUserCssConfigPage()
testHasContentModel( $title, $expectedModelId)
dataGetContentModel Title::hasContentModel
static clearCaches()
Text form (spaces not underscores) of the main part.
static provideIsWikitextPage()
static provideIsUserConfigPage()
static provideIsUserJsConfigPage()
testInNamespaces()
Title::inNamespaces.
const CONTENT_MODEL_WIKITEXT
testIsWikitextPage( $title, $expectedBool)
provideIsWikitextPage Title::isWikitextPage
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
static provideIsSiteConfigPage()
namespace and then decline to actually register it file or subcat img or subcat $title
testGetOtherPage( $text, $expected)
provideGetOtherpage Title::getOtherPage
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
testGetContentModel( $title, $expectedModelId)
dataGetContentModel Title::getContentModel
testIsUserJsConfigPage( $title, $expectedBool)
provideIsUserJsConfigPage Title::isUserJsConfigPage
static provideHasSubjectNamespace()
static provideInNamespace()
testIsUserCssConfigPage( $title, $expectedBool)
provideIsUserCssConfigPage Title::isUserCssConfigPage
testSiteConfigPage( $title, $expectedBool)
provideIsSiteConfigPage Title::isSiteConfigPage
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
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
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
testInNamespace( $title, $ns, $expectedBool)
provideInNamespace Title::inNamespace
testIsUserConfigPage( $title, $expectedBool)
provideIsUserConfigPage Title::isUserConfigPage