From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- tests/phpunit/includes/site/SiteTest.php | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'tests/phpunit/includes/site/SiteTest.php') diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php index d20e2a52..29c1ff33 100644 --- a/tests/phpunit/includes/site/SiteTest.php +++ b/tests/phpunit/includes/site/SiteTest.php @@ -38,6 +38,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getInterwikiIds */ public function testGetInterwikiIds( Site $site ) { $this->assertInternalType( 'array', $site->getInterwikiIds() ); @@ -46,6 +47,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getNavigationIds */ public function testGetNavigationIds( Site $site ) { $this->assertInternalType( 'array', $site->getNavigationIds() ); @@ -54,6 +56,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::addNavigationId */ public function testAddNavigationId( Site $site ) { $site->addNavigationId( 'foobar' ); @@ -63,6 +66,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::addInterwikiId */ public function testAddInterwikiId( Site $site ) { $site->addInterwikiId( 'foobar' ); @@ -72,6 +76,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getLanguageCode */ public function testGetLanguageCode( Site $site ) { $this->assertTypeOrValue( 'string', $site->getLanguageCode(), null ); @@ -80,6 +85,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::setLanguageCode */ public function testSetLanguageCode( Site $site ) { $site->setLanguageCode( 'en' ); @@ -89,6 +95,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::normalizePageName */ public function testNormalizePageName( Site $site ) { $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) ); @@ -97,6 +104,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getGlobalId */ public function testGetGlobalId( Site $site ) { $this->assertTypeOrValue( 'string', $site->getGlobalId(), null ); @@ -105,6 +113,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::setGlobalId */ public function testSetGlobalId( Site $site ) { $site->setGlobalId( 'foobar' ); @@ -114,6 +123,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getType */ public function testGetType( Site $site ) { $this->assertInternalType( 'string', $site->getType() ); @@ -122,6 +132,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getPath */ public function testGetPath( Site $site ) { $this->assertTypeOrValue( 'string', $site->getPath( 'page_path' ), null ); @@ -132,6 +143,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::getAllPaths */ public function testGetAllPaths( Site $site ) { $this->assertInternalType( 'array', $site->getAllPaths() ); @@ -140,6 +152,8 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::setPath + * @covers Site::removePath */ public function testSetAndRemovePath( Site $site ) { $count = count( $site->getAllPaths() ); @@ -162,6 +176,9 @@ class SiteTest extends MediaWikiTestCase { $this->assertNull( $site->getPath( 'spam' ) ); } + /** + * @covers Site::setLinkPath + */ public function testSetLinkPath() { $site = new Site(); $path = "TestPath/$1"; @@ -170,6 +187,9 @@ class SiteTest extends MediaWikiTestCase { $this->assertEquals( $path, $site->getLinkPath() ); } + /** + * @covers Site::getLinkPathType + */ public function testGetLinkPathType() { $site = new Site(); @@ -182,6 +202,9 @@ class SiteTest extends MediaWikiTestCase { $this->assertEquals( $path, $site->getLinkPath() ); } + /** + * @covers Site::setPath + */ public function testSetPath() { $site = new Site(); @@ -191,6 +214,10 @@ class SiteTest extends MediaWikiTestCase { $this->assertEquals( $path, $site->getPath( 'foo' ) ); } + /** + * @covers Site::setPath + * @covers Site::getProtocol + */ public function testProtocolRelativePath() { $site = new Site(); @@ -201,7 +228,7 @@ class SiteTest extends MediaWikiTestCase { $this->assertEquals( '', $site->getProtocol() ); } - public function provideGetPageUrl() { + public static function provideGetPageUrl() { //NOTE: the assumption that the URL is built by replacing $1 // with the urlencoded version of $page // is true for Site but not guaranteed for subclasses. @@ -228,6 +255,7 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider provideGetPageUrl + * @covers Site::getPageUrl */ public function testGetPageUrl( $path, $page, $expected ) { $site = new Site(); @@ -252,6 +280,8 @@ class SiteTest extends MediaWikiTestCase { /** * @dataProvider instanceProvider * @param Site $site + * @covers Site::serialize + * @covers Site::unserialize */ public function testSerialization( Site $site ) { $this->assertInstanceOf( 'Serializable', $site ); @@ -263,5 +293,4 @@ class SiteTest extends MediaWikiTestCase { $this->assertEquals( $serialization, serialize( $newInstance ) ); } - } -- cgit v1.2.3-54-g00ecf