From 4e941cf4ca448077286fc79a48a76d17dd549c9c Mon Sep 17 00:00:00 2001 From: addshore Date: Mon, 21 Oct 2013 10:46:11 +0200 Subject: [PATCH] Add @covers tags for more tests Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e --- tests/phpunit/includes/XmlTest.php | 86 ++++++++++++++++--- .../includes/ZipDirectoryReaderTest.php | 4 + .../includes/filebackend/FileBackendTest.php | 59 ++++++++++++- .../includes/filerepo/FileRepoTest.php | 8 ++ .../includes/filerepo/StoreBatchTest.php | 12 ++- .../installer/OracleInstallerTest.php | 1 + .../includes/site/MediaWikiSiteTest.php | 2 + tests/phpunit/includes/site/SiteListTest.php | 8 ++ .../includes/site/SiteSQLStoreTest.php | 12 +++ tests/phpunit/includes/site/SiteTest.php | 30 +++++++ .../includes/upload/UploadBaseTest.php | 7 +- 11 files changed, 214 insertions(+), 15 deletions(-) diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php index 2294804118..a19883257f 100644 --- a/tests/phpunit/includes/XmlTest.php +++ b/tests/phpunit/includes/XmlTest.php @@ -1,8 +1,6 @@ assertNull( Xml::expandAttributes( null ), 'Converting a null list of attributes' @@ -42,11 +43,17 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::expandAttributes + */ public function testExpandAttributesException() { $this->setExpectedException( 'MWException' ); Xml::expandAttributes( 'string' ); } + /** + * @covers Xml::element + */ function testElementOpen() { $this->assertEquals( '', @@ -55,6 +62,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::element + */ function testElementEmpty() { $this->assertEquals( '', @@ -63,6 +73,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::input + */ function testElementInputCanHaveAValueOfZero() { $this->assertEquals( '', @@ -71,6 +84,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::element + */ function testElementEscaping() { $this->assertEquals( 'hello <there> you & you', @@ -79,12 +95,18 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::escapeTagsOnly + */ public function testEscapeTagsOnly() { $this->assertEquals( '"><', Xml::escapeTagsOnly( '"><' ), 'replace " > and < with their HTML entitites' ); } + /** + * @covers Xml::element + */ function testElementAttributes() { $this->assertEquals( '="<>">', @@ -93,6 +115,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::openElement + */ function testOpenElement() { $this->assertEquals( '', @@ -101,10 +126,16 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::closeElement + */ function testCloseElement() { $this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); } + /** + * @covers Xml::dateMenu + */ public function testDateMenu() { $curYear = intval( gmdate( 'Y' ) ); $prevYear = $curYear - 1; @@ -185,9 +216,9 @@ class XmlTest extends MediaWikiTestCase { ); } - # - # textarea - # + /** + * @covers Xml::textarea + */ function testTextareaNoContent() { $this->assertEquals( '', @@ -196,6 +227,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::textarea + */ function testTextareaAttribs() { $this->assertEquals( '', @@ -204,9 +238,9 @@ class XmlTest extends MediaWikiTestCase { ); } - # - # input and label - # + /** + * @covers Xml::label + */ function testLabelCreation() { $this->assertEquals( '', @@ -215,6 +249,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::label + */ function testLabelAttributeCanOnlyBeClassOrTitle() { $this->assertEquals( '', @@ -244,6 +281,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::languageSelector + */ function testLanguageSelector() { $select = Xml::languageSelector( 'en', true, null, array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) ); @@ -253,9 +293,9 @@ class XmlTest extends MediaWikiTestCase { ); } - # - # JS - # + /** + * @covers Xml::escapeJsString + */ function testEscapeJsStringSpecialChars() { $this->assertEquals( '\\\\\r\n', @@ -264,6 +304,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarBoolean() { $this->assertEquals( 'true', @@ -272,6 +315,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarNull() { $this->assertEquals( 'null', @@ -280,6 +326,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarArray() { $this->assertEquals( '["a",1]', @@ -293,6 +342,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarObject() { $this->assertEquals( '{"a":"a","b":1}', @@ -301,6 +353,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarInt() { $this->assertEquals( '123456', @@ -309,6 +364,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarFloat() { $this->assertEquals( '1.23456', @@ -317,6 +375,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarIntString() { $this->assertEquals( '"123456"', @@ -325,6 +386,9 @@ class XmlTest extends MediaWikiTestCase { ); } + /** + * @covers Xml::encodeJsVar + */ function testEncodeJsVarFloatString() { $this->assertEquals( '"1.23456"', diff --git a/tests/phpunit/includes/ZipDirectoryReaderTest.php b/tests/phpunit/includes/ZipDirectoryReaderTest.php index 3fea57a048..59c7047323 100644 --- a/tests/phpunit/includes/ZipDirectoryReaderTest.php +++ b/tests/phpunit/includes/ZipDirectoryReaderTest.php @@ -1,5 +1,9 @@ assertEquals( $isStorePath, FileBackend::isStoragePath( $path ), @@ -109,6 +116,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testSplitStoragePath + * @covers FileBackend::splitStoragePath */ public function testSplitStoragePath( $path, $res ) { $this->assertEquals( $res, FileBackend::splitStoragePath( $path ), @@ -133,6 +141,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_normalizeStoragePath + * @covers FileBackend::normalizeStoragePath */ public function testNormalizeStoragePath( $path, $res ) { $this->assertEquals( $res, FileBackend::normalizeStoragePath( $path ), @@ -159,6 +168,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testParentStoragePath + * @covers FileBackend::parentStoragePath */ public function testParentStoragePath( $path, $res ) { $this->assertEquals( $res, FileBackend::parentStoragePath( $path ), @@ -180,6 +190,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testExtensionFromPath + * @covers FileBackend::extensionFromPath */ public function testExtensionFromPath( $path, $res ) { $this->assertEquals( $res, FileBackend::extensionFromPath( $path ), @@ -213,6 +224,9 @@ class FileBackendTest extends MediaWikiTestCase { $this->tearDownFiles(); } + /** + * @covers FileBackend::doOperation + */ private function doTestStore( $op ) { $backendName = $this->backendClass(); @@ -284,6 +298,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testCopy + * @covers FileBackend::doOperation */ public function testCopy( $op ) { $this->backend = $this->singleBackend; @@ -404,6 +419,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testMove + * @covers FileBackend::doOperation */ public function testMove( $op ) { $this->backend = $this->singleBackend; @@ -525,6 +541,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testDelete + * @covers FileBackend::doOperation */ public function testDelete( $op, $withSource, $okStatus ) { $this->backend = $this->singleBackend; @@ -616,6 +633,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testDescribe + * @covers FileBackend::doOperation */ public function testDescribe( $op, $withSource, $okStatus ) { $this->backend = $this->singleBackend; @@ -683,6 +701,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testCreate + * @covers FileBackend::doOperation */ public function testCreate( $op, $alreadyExists, $okStatus, $newSize ) { $this->backend = $this->singleBackend; @@ -803,6 +822,9 @@ class FileBackendTest extends MediaWikiTestCase { return $cases; } + /** + * @covers FileBackend::doQuickOperations + */ public function testDoQuickOperations() { $this->backend = $this->singleBackend; $this->doTestDoQuickOperations(); @@ -1019,6 +1041,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testGetFileStat + * @covers FileBackend::getFileStat */ public function testGetFileStat( $path, $content, $alreadyExists ) { $this->backend = $this->singleBackend; @@ -1094,6 +1117,8 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testGetFileContents + * @covers FileBackend::getFileContents + * @covers FileBackend::getFileContentsMulti */ public function testGetFileContents( $source, $content ) { $this->backend = $this->singleBackend; @@ -1153,6 +1178,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testGetLocalCopy + * @covers FileBackend::getLocalCopy */ public function testGetLocalCopy( $source, $content ) { $this->backend = $this->singleBackend; @@ -1222,6 +1248,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testGetLocalReference + * @covers FileBackend::getLocalReference */ public function testGetLocalReference( $source, $content ) { $this->backend = $this->singleBackend; @@ -1286,6 +1313,10 @@ class FileBackendTest extends MediaWikiTestCase { return $cases; } + /** + * @covers FileBackend::getLocalCopy + * @covers FileBackend::getLocalReference + */ public function testGetLocalCopyAndReference404() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -1314,6 +1345,7 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testGetFileHttpUrl + * @covers FileBackend::getFileHttpUrl */ public function testGetFileHttpUrl( $source, $content ) { $this->backend = $this->singleBackend; @@ -1358,6 +1390,8 @@ class FileBackendTest extends MediaWikiTestCase { /** * @dataProvider provider_testPrepareAndClean + * @covers FileBackend::prepare + * @covers FileBackend::clean */ public function testPrepareAndClean( $path, $isOK ) { $this->backend = $this->singleBackend; @@ -1416,6 +1450,9 @@ class FileBackendTest extends MediaWikiTestCase { $this->tearDownFiles(); } + /** + * @covers FileBackend::clean + */ private function doTestRecursiveClean() { $backendName = $this->backendClass(); @@ -1462,6 +1499,9 @@ class FileBackendTest extends MediaWikiTestCase { // @todo testSecure + /** + * @covers FileBackend::doOperations + */ public function testDoOperations() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -1549,6 +1589,9 @@ class FileBackendTest extends MediaWikiTestCase { "Correct file SHA-1 of $fileC" ); } + /** + * @covers FileBackend::doOperations + */ public function testDoOperationsPipeline() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -1648,6 +1691,9 @@ class FileBackendTest extends MediaWikiTestCase { "Correct file SHA-1 of $fileC" ); } + /** + * @covers FileBackend::doOperations + */ public function testDoOperationsFailing() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -1722,6 +1768,9 @@ class FileBackendTest extends MediaWikiTestCase { "Correct file SHA-1 of $fileA" ); } + /** + * @covers FileBackend::getFileList + */ public function testGetFileList() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -1886,6 +1935,10 @@ class FileBackendTest extends MediaWikiTestCase { } } + /** + * @covers FileBackend::getTopDirectoryList + * @covers FileBackend::getDirectoryList + */ public function testGetDirectoryList() { $this->backend = $this->singleBackend; $this->tearDownFiles(); @@ -2092,6 +2145,10 @@ class FileBackendTest extends MediaWikiTestCase { $this->assertEquals( array(), $items, "Directory listing is empty." ); } + /** + * @covers FileBackend::lockFiles + * @covers FileBackend::unlockFiles + */ public function testLockCalls() { $this->backend = $this->singleBackend; $this->doTestLockCalls(); diff --git a/tests/phpunit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php index 033ae0b712..b760e26b69 100644 --- a/tests/phpunit/includes/filerepo/FileRepoTest.php +++ b/tests/phpunit/includes/filerepo/FileRepoTest.php @@ -1,8 +1,10 @@ 'FileRepoTestRepository', diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 71a585ee6e..b33c1bbb39 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -1,10 +1,16 @@ repo->getHashPath( $originalName ); @@ -79,7 +86,7 @@ class StoreBatchTest extends MediaWikiTestCase { * @param $fn string The title of the image * @param $infn string The name of the file (in the filesystem) * @param $otherfn string The name of the different file (in the filesystem) - * @param $fromrepo logical 'true' if we want to copy from a virtual URL out of the Repo. + * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo. */ private function storecohort( $fn, $infn, $otherfn, $fromrepo ) { $f = $this->storeit( $fn, $infn, 0 ); @@ -116,6 +123,9 @@ class StoreBatchTest extends MediaWikiTestCase { $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); } + /** + * @covers FileRepo::store + */ public function teststore() { global $IP; $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false ); diff --git a/tests/phpunit/includes/installer/OracleInstallerTest.php b/tests/phpunit/includes/installer/OracleInstallerTest.php index 7c37f98fe5..592500d7b2 100644 --- a/tests/phpunit/includes/installer/OracleInstallerTest.php +++ b/tests/phpunit/includes/installer/OracleInstallerTest.php @@ -11,6 +11,7 @@ class OracleInstallerTest extends MediaWikiTestCase { /** * @dataProvider provideOracleConnectStrings + * @covers OracleInstaller::checkConnectStringFormat */ function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) { $validity = $expected ? 'should be valid' : 'should NOT be valid'; diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php index e0092a55a2..c5d52d338e 100644 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ b/tests/phpunit/includes/site/MediaWikiSiteTest.php @@ -54,6 +54,7 @@ class MediaWikiSiteTest extends SiteTest { /** * @dataProvider fileUrlProvider + * @covers MediaWikiSite::getFileUrl */ public function testGetFileUrl( $url, $filePath, $pathArgument, $expected ) { $site = new MediaWikiSite(); @@ -77,6 +78,7 @@ class MediaWikiSiteTest extends SiteTest { /** * @dataProvider provideGetPageUrl + * @covers MediaWikiSite::getPageUrl */ public function testGetPageUrl( $path, $page, $expected ) { $site = new MediaWikiSite(); diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php index bd2ae078bb..8af2fc1b95 100644 --- a/tests/phpunit/includes/site/SiteListTest.php +++ b/tests/phpunit/includes/site/SiteListTest.php @@ -68,6 +68,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::isEmpty */ public function testIsEmpty( SiteList $sites ) { $this->assertEquals( count( $sites ) === 0, $sites->isEmpty() ); @@ -76,6 +77,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::getSite */ public function testGetSiteByGlobalId( SiteList $sites ) { if ( $sites->isEmpty() ) { @@ -93,6 +95,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::getSiteByInternalId */ public function testGetSiteByInternalId( $sites ) { /** @@ -110,6 +113,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::hasSite */ public function testHasGlobalId( $sites ) { $this->assertFalse( $sites->hasSite( 'non-existing-global-id' ) ); @@ -128,6 +132,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::hasInternalId */ public function testHasInternallId( $sites ) { /** @@ -145,6 +150,7 @@ class SiteListTest extends MediaWikiTestCase { /** * @dataProvider siteListProvider * @param SiteList $sites + * @covers SiteList::getGlobalIdentifiers */ public function testGetGlobalIdentifiers( SiteList $sites ) { $identifiers = $sites->getGlobalIdentifiers(); @@ -169,6 +175,8 @@ class SiteListTest extends MediaWikiTestCase { * @since 1.21 * * @param SiteList $list + * @covers SiteList::getSerializationData + * @covers SiteList::unserialize */ public function testSerialization( SiteList $list ) { $serialization = serialize( $list ); diff --git a/tests/phpunit/includes/site/SiteSQLStoreTest.php b/tests/phpunit/includes/site/SiteSQLStoreTest.php index cf652e957c..6002c1a143 100644 --- a/tests/phpunit/includes/site/SiteSQLStoreTest.php +++ b/tests/phpunit/includes/site/SiteSQLStoreTest.php @@ -32,6 +32,9 @@ */ class SiteSQLStoreTest extends MediaWikiTestCase { + /** + * @covers SiteSQLStore::getSites + */ public function testGetSites() { $expectedSites = TestSites::getSites(); TestSites::insertIntoDb(); @@ -56,6 +59,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase { } } + /** + * @covers SiteSQLStore::saveSites + */ public function testSaveSites() { $store = SiteSQLStore::newInstance(); @@ -86,6 +92,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase { $this->assertTrue( $site->getInternalId() >= 0 ); } + /** + * @covers SiteSQLStore::reset + */ public function testReset() { $store1 = SiteSQLStore::newInstance(); $store2 = SiteSQLStore::newInstance(); @@ -109,6 +118,9 @@ class SiteSQLStoreTest extends MediaWikiTestCase { $this->assertNull( $site ); } + /** + * @covers SiteSQLStore::clear + */ public function testClear() { $store = SiteSQLStore::newInstance(); $this->assertTrue( $store->clear() ); diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php index b453e7437e..29c1ff3308 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(); @@ -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 ); diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php b/tests/phpunit/includes/upload/UploadBaseTest.php index 298420bc90..982b46b26b 100644 --- a/tests/phpunit/includes/upload/UploadBaseTest.php +++ b/tests/phpunit/includes/upload/UploadBaseTest.php @@ -1,10 +1,12 @@