jenkins-bot has submitted this change and it was merged.
Change subject: Add @covers tags for more tests
......................................................................
Add @covers tags for more tests
Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
---
M tests/phpunit/includes/XmlTest.php
M tests/phpunit/includes/ZipDirectoryReaderTest.php
M tests/phpunit/includes/filebackend/FileBackendTest.php
M tests/phpunit/includes/filerepo/FileRepoTest.php
M tests/phpunit/includes/filerepo/StoreBatchTest.php
M tests/phpunit/includes/installer/OracleInstallerTest.php
M tests/phpunit/includes/site/MediaWikiSiteTest.php
M tests/phpunit/includes/site/SiteListTest.php
M tests/phpunit/includes/site/SiteSQLStoreTest.php
M tests/phpunit/includes/site/SiteTest.php
M tests/phpunit/includes/upload/UploadBaseTest.php
11 files changed, 214 insertions(+), 15 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/XmlTest.php
b/tests/phpunit/includes/XmlTest.php
index 2294804..a198832 100644
--- a/tests/phpunit/includes/XmlTest.php
+++ b/tests/phpunit/includes/XmlTest.php
@@ -1,8 +1,6 @@
<?php
class XmlTest extends MediaWikiTestCase {
- private static $oldLang;
- private static $oldNamespaces;
protected function setUp() {
parent::setUp();
@@ -33,6 +31,9 @@
) );
}
+ /**
+ * @covers Xml::expandAttributes
+ */
public function testExpandAttributes() {
$this->assertNull( Xml::expandAttributes( null ),
'Converting a null list of attributes'
@@ -42,11 +43,17 @@
);
}
+ /**
+ * @covers Xml::expandAttributes
+ */
public function testExpandAttributesException() {
$this->setExpectedException( 'MWException' );
Xml::expandAttributes( 'string' );
}
+ /**
+ * @covers Xml::element
+ */
function testElementOpen() {
$this->assertEquals(
'<element>',
@@ -55,6 +62,9 @@
);
}
+ /**
+ * @covers Xml::element
+ */
function testElementEmpty() {
$this->assertEquals(
'<element />',
@@ -63,6 +73,9 @@
);
}
+ /**
+ * @covers Xml::input
+ */
function testElementInputCanHaveAValueOfZero() {
$this->assertEquals(
'<input name="name" value="0" />',
@@ -71,6 +84,9 @@
);
}
+ /**
+ * @covers Xml::element
+ */
function testElementEscaping() {
$this->assertEquals(
'<element>hello <there> you & you</element>',
@@ -79,12 +95,18 @@
);
}
+ /**
+ * @covers Xml::escapeTagsOnly
+ */
public function testEscapeTagsOnly() {
$this->assertEquals( '"><', Xml::escapeTagsOnly(
'"><' ),
'replace " > and < with their HTML entitites'
);
}
+ /**
+ * @covers Xml::element
+ */
function testElementAttributes() {
$this->assertEquals(
'<element key="value" <>="<>">',
@@ -93,6 +115,9 @@
);
}
+ /**
+ * @covers Xml::openElement
+ */
function testOpenElement() {
$this->assertEquals(
'<element k="v">',
@@ -101,10 +126,16 @@
);
}
+ /**
+ * @covers Xml::closeElement
+ */
function testCloseElement() {
$this->assertEquals( '</element>', Xml::closeElement( 'element'
), 'closeElement() shortcut' );
}
+ /**
+ * @covers Xml::dateMenu
+ */
public function testDateMenu() {
$curYear = intval( gmdate( 'Y' ) );
$prevYear = $curYear - 1;
@@ -185,9 +216,9 @@
);
}
- #
- # textarea
- #
+ /**
+ * @covers Xml::textarea
+ */
function testTextareaNoContent() {
$this->assertEquals(
'<textarea name="name" id="name" cols="40"
rows="5"></textarea>',
@@ -196,6 +227,9 @@
);
}
+ /**
+ * @covers Xml::textarea
+ */
function testTextareaAttribs() {
$this->assertEquals(
'<textarea name="name" id="name" cols="20"
rows="10"><txt></textarea>',
@@ -204,9 +238,9 @@
);
}
- #
- # input and label
- #
+ /**
+ * @covers Xml::label
+ */
function testLabelCreation() {
$this->assertEquals(
'<label for="id">name</label>',
@@ -215,6 +249,9 @@
);
}
+ /**
+ * @covers Xml::label
+ */
function testLabelAttributeCanOnlyBeClassOrTitle() {
$this->assertEquals(
'<label for="id">name</label>',
@@ -244,6 +281,9 @@
);
}
+ /**
+ * @covers Xml::languageSelector
+ */
function testLanguageSelector() {
$select = Xml::languageSelector( 'en', true, null,
array( 'id' => 'testlang' ), wfMessage( 'yourlanguage'
) );
@@ -253,9 +293,9 @@
);
}
- #
- # JS
- #
+ /**
+ * @covers Xml::escapeJsString
+ */
function testEscapeJsStringSpecialChars() {
$this->assertEquals(
'\\\\\r\n',
@@ -264,6 +304,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarBoolean() {
$this->assertEquals(
'true',
@@ -272,6 +315,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarNull() {
$this->assertEquals(
'null',
@@ -280,6 +326,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarArray() {
$this->assertEquals(
'["a",1]',
@@ -293,6 +342,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarObject() {
$this->assertEquals(
'{"a":"a","b":1}',
@@ -301,6 +353,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarInt() {
$this->assertEquals(
'123456',
@@ -309,6 +364,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarFloat() {
$this->assertEquals(
'1.23456',
@@ -317,6 +375,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarIntString() {
$this->assertEquals(
'"123456"',
@@ -325,6 +386,9 @@
);
}
+ /**
+ * @covers Xml::encodeJsVar
+ */
function testEncodeJsVarFloatString() {
$this->assertEquals(
'"1.23456"',
diff --git a/tests/phpunit/includes/ZipDirectoryReaderTest.php
b/tests/phpunit/includes/ZipDirectoryReaderTest.php
index 3fea57a..59c7047 100644
--- a/tests/phpunit/includes/ZipDirectoryReaderTest.php
+++ b/tests/phpunit/includes/ZipDirectoryReaderTest.php
@@ -1,5 +1,9 @@
<?php
+/**
+ * @covers ZipDirectoryReader
+ * NOTE: this test is more like an integration test than a unit test
+ */
class ZipDirectoryReaderTest extends MediaWikiTestCase {
var $zipDir, $entries;
diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php
b/tests/phpunit/includes/filebackend/FileBackendTest.php
index 013bbe2..fcfa724 100644
--- a/tests/phpunit/includes/filebackend/FileBackendTest.php
+++ b/tests/phpunit/includes/filebackend/FileBackendTest.php
@@ -6,7 +6,13 @@
* @group medium
*/
class FileBackendTest extends MediaWikiTestCase {
- private $backend, $multiBackend;
+
+ /** @var FileBackend */
+ private $backend;
+ /** @var FileBackendMultiWrite */
+ private $multiBackend;
+ /** @var FSFileBackend */
+ public $singleBackend;
private $filesToPrune = array();
private static $backendToUse;
@@ -85,6 +91,7 @@
/**
* @dataProvider provider_testIsStoragePath
+ * @covers FileBackend::isStoragePath
*/
public function testIsStoragePath( $path, $isStorePath ) {
$this->assertEquals( $isStorePath, FileBackend::isStoragePath(
$path ),
@@ -109,6 +116,7 @@
/**
* @dataProvider provider_testSplitStoragePath
+ * @covers FileBackend::splitStoragePath
*/
public function testSplitStoragePath( $path, $res ) {
$this->assertEquals( $res, FileBackend::splitStoragePath( $path
),
@@ -133,6 +141,7 @@
/**
* @dataProvider provider_normalizeStoragePath
+ * @covers FileBackend::normalizeStoragePath
*/
public function testNormalizeStoragePath( $path, $res ) {
$this->assertEquals( $res, FileBackend::normalizeStoragePath(
$path ),
@@ -159,6 +168,7 @@
/**
* @dataProvider provider_testParentStoragePath
+ * @covers FileBackend::parentStoragePath
*/
public function testParentStoragePath( $path, $res ) {
$this->assertEquals( $res, FileBackend::parentStoragePath(
$path ),
@@ -180,6 +190,7 @@
/**
* @dataProvider provider_testExtensionFromPath
+ * @covers FileBackend::extensionFromPath
*/
public function testExtensionFromPath( $path, $res ) {
$this->assertEquals( $res, FileBackend::extensionFromPath(
$path ),
@@ -213,6 +224,9 @@
$this->tearDownFiles();
}
+ /**
+ * @covers FileBackend::doOperation
+ */
private function doTestStore( $op ) {
$backendName = $this->backendClass();
@@ -284,6 +298,7 @@
/**
* @dataProvider provider_testCopy
+ * @covers FileBackend::doOperation
*/
public function testCopy( $op ) {
$this->backend = $this->singleBackend;
@@ -404,6 +419,7 @@
/**
* @dataProvider provider_testMove
+ * @covers FileBackend::doOperation
*/
public function testMove( $op ) {
$this->backend = $this->singleBackend;
@@ -525,6 +541,7 @@
/**
* @dataProvider provider_testDelete
+ * @covers FileBackend::doOperation
*/
public function testDelete( $op, $withSource, $okStatus ) {
$this->backend = $this->singleBackend;
@@ -616,6 +633,7 @@
/**
* @dataProvider provider_testDescribe
+ * @covers FileBackend::doOperation
*/
public function testDescribe( $op, $withSource, $okStatus ) {
$this->backend = $this->singleBackend;
@@ -683,6 +701,7 @@
/**
* @dataProvider provider_testCreate
+ * @covers FileBackend::doOperation
*/
public function testCreate( $op, $alreadyExists, $okStatus, $newSize ) {
$this->backend = $this->singleBackend;
@@ -803,6 +822,9 @@
return $cases;
}
+ /**
+ * @covers FileBackend::doQuickOperations
+ */
public function testDoQuickOperations() {
$this->backend = $this->singleBackend;
$this->doTestDoQuickOperations();
@@ -1019,6 +1041,7 @@
/**
* @dataProvider provider_testGetFileStat
+ * @covers FileBackend::getFileStat
*/
public function testGetFileStat( $path, $content, $alreadyExists ) {
$this->backend = $this->singleBackend;
@@ -1094,6 +1117,8 @@
/**
* @dataProvider provider_testGetFileContents
+ * @covers FileBackend::getFileContents
+ * @covers FileBackend::getFileContentsMulti
*/
public function testGetFileContents( $source, $content ) {
$this->backend = $this->singleBackend;
@@ -1153,6 +1178,7 @@
/**
* @dataProvider provider_testGetLocalCopy
+ * @covers FileBackend::getLocalCopy
*/
public function testGetLocalCopy( $source, $content ) {
$this->backend = $this->singleBackend;
@@ -1222,6 +1248,7 @@
/**
* @dataProvider provider_testGetLocalReference
+ * @covers FileBackend::getLocalReference
*/
public function testGetLocalReference( $source, $content ) {
$this->backend = $this->singleBackend;
@@ -1286,6 +1313,10 @@
return $cases;
}
+ /**
+ * @covers FileBackend::getLocalCopy
+ * @covers FileBackend::getLocalReference
+ */
public function testGetLocalCopyAndReference404() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -1314,6 +1345,7 @@
/**
* @dataProvider provider_testGetFileHttpUrl
+ * @covers FileBackend::getFileHttpUrl
*/
public function testGetFileHttpUrl( $source, $content ) {
$this->backend = $this->singleBackend;
@@ -1358,6 +1390,8 @@
/**
* @dataProvider provider_testPrepareAndClean
+ * @covers FileBackend::prepare
+ * @covers FileBackend::clean
*/
public function testPrepareAndClean( $path, $isOK ) {
$this->backend = $this->singleBackend;
@@ -1416,6 +1450,9 @@
$this->tearDownFiles();
}
+ /**
+ * @covers FileBackend::clean
+ */
private function doTestRecursiveClean() {
$backendName = $this->backendClass();
@@ -1462,6 +1499,9 @@
// @todo testSecure
+ /**
+ * @covers FileBackend::doOperations
+ */
public function testDoOperations() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -1549,6 +1589,9 @@
"Correct file SHA-1 of $fileC" );
}
+ /**
+ * @covers FileBackend::doOperations
+ */
public function testDoOperationsPipeline() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -1648,6 +1691,9 @@
"Correct file SHA-1 of $fileC" );
}
+ /**
+ * @covers FileBackend::doOperations
+ */
public function testDoOperationsFailing() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -1722,6 +1768,9 @@
"Correct file SHA-1 of $fileA" );
}
+ /**
+ * @covers FileBackend::getFileList
+ */
public function testGetFileList() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -1886,6 +1935,10 @@
}
}
+ /**
+ * @covers FileBackend::getTopDirectoryList
+ * @covers FileBackend::getDirectoryList
+ */
public function testGetDirectoryList() {
$this->backend = $this->singleBackend;
$this->tearDownFiles();
@@ -2092,6 +2145,10 @@
$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 033ae0b..b760e26 100644
--- a/tests/phpunit/includes/filerepo/FileRepoTest.php
+++ b/tests/phpunit/includes/filerepo/FileRepoTest.php
@@ -1,8 +1,10 @@
<?php
class FileRepoTest extends MediaWikiTestCase {
+
/**
* @expectedException MWException
+ * @covers FileRepo::__construct
*/
function testFileRepoConstructionOptionCanNotBeNull() {
new FileRepo();
@@ -10,6 +12,7 @@
/**
* @expectedException MWException
+ * @covers FileRepo::__construct
*/
function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
new FileRepo( array() );
@@ -17,6 +20,7 @@
/**
* @expectedException MWException
+ * @covers FileRepo::__construct
*/
function testFileRepoConstructionOptionNeedNameKey() {
new FileRepo( array(
@@ -26,6 +30,7 @@
/**
* @expectedException MWException
+ * @covers FileRepo::__construct
*/
function testFileRepoConstructionOptionNeedBackendKey() {
new FileRepo( array(
@@ -33,6 +38,9 @@
) );
}
+ /**
+ * @covers FileRepo::__construct
+ */
function testFileRepoConstructionWithRequiredOptions() {
$f = new FileRepo( array(
'name' => 'FileRepoTestRepository',
diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php
b/tests/phpunit/includes/filerepo/StoreBatchTest.php
index 71a585e..b33c1bb 100644
--- a/tests/phpunit/includes/filerepo/StoreBatchTest.php
+++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php
@@ -1,9 +1,15 @@
<?php
+
/**
* @group FileRepo
* @group medium
*/
class StoreBatchTest extends MediaWikiTestCase {
+
+ protected $createdFiles;
+ protected $date;
+ /** @var FileRepo */
+ protected $repo;
protected function setUp() {
global $wgFileBackends;
@@ -60,6 +66,7 @@
* @param $originalName string The title of the image
* @param $srcPath string The filepath or virtual URL
* @param $flags integer Flags to pass into repo::store().
+ * @return FileRepoStatus
*/
private function storeit( $originalName, $srcPath, $flags ) {
$hashPath = $this->repo->getHashPath( $originalName );
@@ -79,7 +86,7 @@
* @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 @@
$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 7c37f98..592500d 100644
--- a/tests/phpunit/includes/installer/OracleInstallerTest.php
+++ b/tests/phpunit/includes/installer/OracleInstallerTest.php
@@ -11,6 +11,7 @@
/**
* @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 e0092a5..c5d52d3 100644
--- a/tests/phpunit/includes/site/MediaWikiSiteTest.php
+++ b/tests/phpunit/includes/site/MediaWikiSiteTest.php
@@ -54,6 +54,7 @@
/**
* @dataProvider fileUrlProvider
+ * @covers MediaWikiSite::getFileUrl
*/
public function testGetFileUrl( $url, $filePath, $pathArgument,
$expected ) {
$site = new MediaWikiSite();
@@ -77,6 +78,7 @@
/**
* @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 bd2ae07..8af2fc1 100644
--- a/tests/phpunit/includes/site/SiteListTest.php
+++ b/tests/phpunit/includes/site/SiteListTest.php
@@ -68,6 +68,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::isEmpty
*/
public function testIsEmpty( SiteList $sites ) {
$this->assertEquals( count( $sites ) === 0, $sites->isEmpty() );
@@ -76,6 +77,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::getSite
*/
public function testGetSiteByGlobalId( SiteList $sites ) {
if ( $sites->isEmpty() ) {
@@ -93,6 +95,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::getSiteByInternalId
*/
public function testGetSiteByInternalId( $sites ) {
/**
@@ -110,6 +113,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::hasSite
*/
public function testHasGlobalId( $sites ) {
$this->assertFalse( $sites->hasSite( 'non-existing-global-id' )
);
@@ -128,6 +132,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::hasInternalId
*/
public function testHasInternallId( $sites ) {
/**
@@ -145,6 +150,7 @@
/**
* @dataProvider siteListProvider
* @param SiteList $sites
+ * @covers SiteList::getGlobalIdentifiers
*/
public function testGetGlobalIdentifiers( SiteList $sites ) {
$identifiers = $sites->getGlobalIdentifiers();
@@ -169,6 +175,8 @@
* @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 cf652e9..6002c1a 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 @@
}
}
+ /**
+ * @covers SiteSQLStore::saveSites
+ */
public function testSaveSites() {
$store = SiteSQLStore::newInstance();
@@ -86,6 +92,9 @@
$this->assertTrue( $site->getInternalId() >= 0 );
}
+ /**
+ * @covers SiteSQLStore::reset
+ */
public function testReset() {
$store1 = SiteSQLStore::newInstance();
$store2 = SiteSQLStore::newInstance();
@@ -109,6 +118,9 @@
$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 b453e74..29c1ff3 100644
--- a/tests/phpunit/includes/site/SiteTest.php
+++ b/tests/phpunit/includes/site/SiteTest.php
@@ -38,6 +38,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getInterwikiIds
*/
public function testGetInterwikiIds( Site $site ) {
$this->assertInternalType( 'array', $site->getInterwikiIds() );
@@ -46,6 +47,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getNavigationIds
*/
public function testGetNavigationIds( Site $site ) {
$this->assertInternalType( 'array', $site->getNavigationIds() );
@@ -54,6 +56,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::addNavigationId
*/
public function testAddNavigationId( Site $site ) {
$site->addNavigationId( 'foobar' );
@@ -63,6 +66,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::addInterwikiId
*/
public function testAddInterwikiId( Site $site ) {
$site->addInterwikiId( 'foobar' );
@@ -72,6 +76,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getLanguageCode
*/
public function testGetLanguageCode( Site $site ) {
$this->assertTypeOrValue( 'string', $site->getLanguageCode(),
null );
@@ -80,6 +85,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::setLanguageCode
*/
public function testSetLanguageCode( Site $site ) {
$site->setLanguageCode( 'en' );
@@ -89,6 +95,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::normalizePageName
*/
public function testNormalizePageName( Site $site ) {
$this->assertInternalType( 'string', $site->normalizePageName(
'Foobar' ) );
@@ -97,6 +104,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getGlobalId
*/
public function testGetGlobalId( Site $site ) {
$this->assertTypeOrValue( 'string', $site->getGlobalId(), null
);
@@ -105,6 +113,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::setGlobalId
*/
public function testSetGlobalId( Site $site ) {
$site->setGlobalId( 'foobar' );
@@ -114,6 +123,7 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getType
*/
public function testGetType( Site $site ) {
$this->assertInternalType( 'string', $site->getType() );
@@ -122,6 +132,7 @@
/**
* @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 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::getAllPaths
*/
public function testGetAllPaths( Site $site ) {
$this->assertInternalType( 'array', $site->getAllPaths() );
@@ -140,6 +152,8 @@
/**
* @dataProvider instanceProvider
* @param Site $site
+ * @covers Site::setPath
+ * @covers Site::removePath
*/
public function testSetAndRemovePath( Site $site ) {
$count = count( $site->getAllPaths() );
@@ -162,6 +176,9 @@
$this->assertNull( $site->getPath( 'spam' ) );
}
+ /**
+ * @covers Site::setLinkPath
+ */
public function testSetLinkPath() {
$site = new Site();
$path = "TestPath/$1";
@@ -170,6 +187,9 @@
$this->assertEquals( $path, $site->getLinkPath() );
}
+ /**
+ * @covers Site::getLinkPathType
+ */
public function testGetLinkPathType() {
$site = new Site();
@@ -182,6 +202,9 @@
$this->assertEquals( $path, $site->getLinkPath() );
}
+ /**
+ * @covers Site::setPath
+ */
public function testSetPath() {
$site = new Site();
@@ -191,6 +214,10 @@
$this->assertEquals( $path, $site->getPath( 'foo' ) );
}
+ /**
+ * @covers Site::setPath
+ * @covers Site::getProtocol
+ */
public function testProtocolRelativePath() {
$site = new Site();
@@ -228,6 +255,7 @@
/**
* @dataProvider provideGetPageUrl
+ * @covers Site::getPageUrl
*/
public function testGetPageUrl( $path, $page, $expected ) {
$site = new Site();
@@ -252,6 +280,8 @@
/**
* @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 298420b..982b46b 100644
--- a/tests/phpunit/includes/upload/UploadBaseTest.php
+++ b/tests/phpunit/includes/upload/UploadBaseTest.php
@@ -1,10 +1,12 @@
<?php
+
/**
* @group Upload
*/
class UploadBaseTest extends MediaWikiTestCase {
- protected $upload;
+ /** @var UploadTestHandler */
+ protected $upload;
protected function setUp() {
global $wgHooks;
@@ -30,6 +32,7 @@
* of UploadBase::getTitle() and then the actual returned title
*
* @dataProvider provideTestTitleValidation
+ * @covers UploadBase::getTitle
*/
public function testTitleValidation( $srcFilename, $dstFilename, $code,
$msg ) {
/* Check the result code */
@@ -82,6 +85,7 @@
/**
* Test the upload verification functions
+ * @covers UploadBase::verifyUpload
*/
public function testVerifyUpload() {
/* Setup with zero file size */
@@ -108,7 +112,6 @@
*
* This method should be abstracted so we can test different settings.
*/
-
public function testMaxUploadSize() {
global $wgMaxUploadSize;
$savedGlobal = $wgMaxUploadSize; // save global
--
To view, visit https://gerrit.wikimedia.org/r/90872
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits