119 $this->assertEquals(
'foobar', $site->
getGlobalId() );
128 $this->assertInternalType(
'string', $site->
getType() );
148 $this->assertInternalType(
'array', $site->
getAllPaths() );
160 $site->
setPath(
'spam',
'http://www.wikidata.org/$1' );
161 $site->
setPath(
'spam',
'http://www.wikidata.org/foo/$1' );
162 $site->
setPath(
'foobar',
'http://www.wikidata.org/bar/$1' );
166 $this->assertInternalType(
'string', $site->
getPath(
'foobar' ) );
167 $this->assertEquals(
'http://www.wikidata.org/foo/$1', $site->
getPath(
'spam' ) );
174 $this->assertNull( $site->
getPath(
'foobar' ) );
175 $this->assertNull( $site->
getPath(
'spam' ) );
183 $path =
"TestPath/$1";
185 $site->setLinkPath(
$path );
186 $this->assertEquals(
$path, $site->getLinkPath() );
195 $path =
'TestPath/$1';
196 $site->setLinkPath(
$path );
197 $this->assertEquals(
$path, $site->getPath( $site->getLinkPathType() ) );
199 $path =
'AnotherPath/$1';
200 $site->setPath( $site->getLinkPathType(),
$path );
201 $this->assertEquals(
$path, $site->getLinkPath() );
210 $path =
'TestPath/$1';
211 $site->setPath(
'foo',
$path );
213 $this->assertEquals(
$path, $site->getPath(
'foo' ) );
223 $type = $site->getLinkPathType();
224 $path =
'//acme.com/';
227 $this->assertEquals(
'', $site->getProtocol() );
238 'http://acme.test/TestPath/$1',
243 'http://acme.test/TestScript?x=$1&y=bla',
245 'TestScript?x=Foo&y=bla',
248 'http://acme.test/TestPath/$1',
249 'foo & bar/xyzzy (quux-shmoox?)',
250 '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29',
265 $site->setLinkPath(
$path );
266 $this->assertContains(
$path, $site->getPageUrl() );
268 $this->assertContains( $expected, $site->getPageUrl(
$page ) );
273 $this->assertTrue(
true );
286 $this->assertInstanceOf(
'Serializable', $site );
291 $this->assertInstanceOf(
'Site', $newInstance );
293 $this->assertEquals( $serialization,
serialize( $newInstance ) );
getInterwikiIds()
Returns the interwiki link identifiers that can be used for this site.
testGetLinkPathType()
Site::getLinkPathType.
testAddInterwikiId(Site $site)
instanceProvider
addNavigationId($identifier)
Adds a navigation id to the site.
testProtocolRelativePath()
Site::setPath Site::getProtocol.
assertTypeOrFalse($type, $value)
removePath($pathType)
Removes the path of the provided type if it's set.
testAddNavigationId(Site $site)
instanceProvider
normalizePageName($pageName)
Returns $pageName without changes.
testSetLanguageCode(Site $site)
instanceProvider
setLanguageCode($languageCode)
Sets language code of the sites primary language.
testSetAndRemovePath(Site $site)
instanceProvider
testGetGlobalId(Site $site)
instanceProvider
getLanguageCode()
Returns language code of the sites primary language.
setPath($pathType, $fullUrl)
Sets the path used to construct links with.
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
testSerialization(Site $site)
instanceProvider
getAllPaths()
Returns the paths as associative array.
testGetNavigationIds(Site $site)
instanceProvider
testGetAllPaths(Site $site)
instanceProvider
testNormalizePageName(Site $site)
instanceProvider
testSetLinkPath()
Site::setLinkPath.
getPath($pathType)
Returns the path of the provided type or false if there is no such path.
testGetPageUrl($path, $page, $expected)
provideGetPageUrl Site::getPageUrl
addInterwikiId($identifier)
Adds an interwiki id to the site.
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
getNavigationIds()
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such ...
getGlobalId()
Returns the global site identifier (ie enwiktionary).
getType()
Returns the type of the site (ie mediawiki).
testGetPath(Site $site)
instanceProvider
testGetLanguageCode(Site $site)
instanceProvider
testGetInterwikiIds(Site $site)
instanceProvider
static provideGetPageUrl()
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
testSetPath()
Site::setPath.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
setGlobalId($globalId)
Sets the global site identifier (ie enwiktionary).
testSetGlobalId(Site $site)
instanceProvider
testGetType(Site $site)
instanceProvider