Go to the documentation of this file.
120 $this->assertEquals(
'foobar', $site->
getGlobalId() );
129 $this->assertInternalType(
'string', $site->
getType() );
149 $this->assertInternalType(
'array', $site->
getAllPaths() );
161 $site->
setPath(
'spam',
'http://www.wikidata.org/$1' );
162 $site->
setPath(
'spam',
'http://www.wikidata.org/foo/$1' );
163 $site->
setPath(
'foobar',
'http://www.wikidata.org/bar/$1' );
167 $this->assertInternalType(
'string', $site->
getPath(
'foobar' ) );
168 $this->assertEquals(
'http://www.wikidata.org/foo/$1', $site->
getPath(
'spam' ) );
175 $this->assertNull( $site->
getPath(
'foobar' ) );
176 $this->assertNull( $site->
getPath(
'spam' ) );
184 $path =
"TestPath/$1";
186 $site->setLinkPath(
$path );
187 $this->assertEquals(
$path, $site->getLinkPath() );
196 $path =
'TestPath/$1';
197 $site->setLinkPath(
$path );
198 $this->assertEquals(
$path, $site->getPath( $site->getLinkPathType() ) );
200 $path =
'AnotherPath/$1';
201 $site->setPath( $site->getLinkPathType(),
$path );
202 $this->assertEquals(
$path, $site->getLinkPath() );
211 $path =
'TestPath/$1';
212 $site->setPath(
'foo',
$path );
214 $this->assertEquals(
$path, $site->getPath(
'foo' ) );
224 $type = $site->getLinkPathType();
225 $path =
'//acme.com/';
228 $this->assertEquals(
'', $site->getProtocol() );
239 'http://acme.test/TestPath/$1',
244 'http://acme.test/TestScript?x=$1&y=bla',
246 'TestScript?x=Foo&y=bla',
249 'http://acme.test/TestPath/$1',
250 'foo & bar/xyzzy (quux-shmoox?)',
251 '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29',
266 $site->setLinkPath(
$path );
267 $this->assertContains(
$path, $site->getPageUrl() );
269 $this->assertContains( $expected, $site->getPageUrl( $page ) );
274 $this->assertTrue(
true );
287 $this->assertInstanceOf(
'Serializable', $site );
289 $serialization = serialize( $site );
290 $newInstance = unserialize( $serialization );
292 $this->assertInstanceOf(
'Site', $newInstance );
294 $this->assertEquals( $serialization, serialize( $newInstance ) );
testGetLinkPathType()
@covers Site::getLinkPathType
testSetLanguageCode(Site $site)
@dataProvider instanceProvider
getInterwikiIds()
Returns the interwiki link identifiers that can be used for this site.
testSetGlobalId(Site $site)
@dataProvider instanceProvider
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
testAddInterwikiId(Site $site)
@dataProvider instanceProvider
getType()
Returns the type of the site (ie mediawiki).
assertTypeOrFalse( $type, $value)
getPath( $pathType)
Returns the path of the provided type or false if there is no such path.
testGetInterwikiIds(Site $site)
@dataProvider instanceProvider
getLanguageCode()
Returns language code of the sites primary language.
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
testGetPageUrl( $path, $page, $expected)
@dataProvider provideGetPageUrl @covers Site::getPageUrl
static provideGetPageUrl()
testAddNavigationId(Site $site)
@dataProvider instanceProvider
testSetPath()
@covers Site::setPath
testGetAllPaths(Site $site)
@dataProvider instanceProvider
testSetLinkPath()
@covers Site::setLinkPath
getGlobalId()
Returns the global site identifier (ie enwiktionary).
testGetNavigationIds(Site $site)
@dataProvider instanceProvider
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
testNormalizePageName(Site $site)
@dataProvider instanceProvider
setLanguageCode( $languageCode)
Sets language code of the sites primary language.
testGetType(Site $site)
@dataProvider instanceProvider
testGetPath(Site $site)
@dataProvider instanceProvider
addInterwikiId( $identifier)
Adds an interwiki id to the site.
testSerialization(Site $site)
@dataProvider instanceProvider
addNavigationId( $identifier)
Adds a navigation id to the site.
setPath( $pathType, $fullUrl)
Sets the path used to construct links with.
getNavigationIds()
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such ...
getAllPaths()
Returns the paths as associative array.
removePath( $pathType)
Removes the path of the provided type if it's set.
testGetGlobalId(Site $site)
@dataProvider instanceProvider
testGetLanguageCode(Site $site)
@dataProvider instanceProvider
setGlobalId( $globalId)
Sets the global site identifier (ie enwiktionary).
normalizePageName( $pageName)
Returns $pageName without changes.
testProtocolRelativePath()
@covers Site::setPath @covers Site::getProtocol
testSetAndRemovePath(Site $site)
@dataProvider instanceProvider