From 61e2c04e4e3717d9421629c23398bb51741ec367 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 28 Dec 2017 00:22:35 -0800 Subject: [PATCH] Add @covers tags to miscellaneous tests (#2) Change-Id: I9116598bee4f4917e02290d273644c13475ff721 --- tests/phpunit/includes/AutopromoteTest.php | 3 +++ tests/phpunit/includes/BlockTest.php | 9 +++++++++ tests/phpunit/includes/exception/MWExceptionTest.php | 1 + tests/phpunit/includes/media/ExifRotationTest.php | 5 ++++- tests/phpunit/includes/parser/MagicVariableTest.php | 4 +++- tests/phpunit/skins/SideBarTest.php | 2 ++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/AutopromoteTest.php b/tests/phpunit/includes/AutopromoteTest.php index 785aa4e3d4..24f6596ea9 100644 --- a/tests/phpunit/includes/AutopromoteTest.php +++ b/tests/phpunit/includes/AutopromoteTest.php @@ -1,5 +1,8 @@ getUserForBlocking(); @@ -366,6 +367,9 @@ class BlockTest extends MediaWikiLangTestCase { $this->assertEquals( $exResult, $block->mReason, 'Correct block type for XFF header ' . $xff ); } + /** + * @covers Block::__construct + */ public function testDeprecatedConstructor() { $this->hideDeprecated( 'Block::__construct with multiple arguments' ); $username = 'UnthinkablySecretRandomUsername'; @@ -418,6 +422,11 @@ class BlockTest extends MediaWikiLangTestCase { ); } + /** + * @covers Block::getSystemBlockType + * @covers Block::insert + * @covers Block::doAutoblock + */ public function testSystemBlocks() { $user = $this->getUserForBlocking(); $this->addBlockForUser( $user ); diff --git a/tests/phpunit/includes/exception/MWExceptionTest.php b/tests/phpunit/includes/exception/MWExceptionTest.php index 614a1c981d..6c5b3b1eae 100644 --- a/tests/phpunit/includes/exception/MWExceptionTest.php +++ b/tests/phpunit/includes/exception/MWExceptionTest.php @@ -10,6 +10,7 @@ class MWExceptionTest extends MediaWikiTestCase { /** * @expectedException MWException + * @covers MWException */ public function testMwexceptionThrowing() { throw new MWException(); diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php index 5ae1763596..fff101f3a2 100644 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ b/tests/phpunit/includes/media/ExifRotationTest.php @@ -5,10 +5,13 @@ * @group Media * @group medium * - * @todo covers tags + * @covers BitmapHandler */ class ExifRotationTest extends MediaWikiMediaTestCase { + /** @var BitmapHandler */ + private $handler; + protected function setUp() { parent::setUp(); $this->checkPHPExtension( 'exif' ); diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index 6a2afad6d7..9f5e38640e 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -9,11 +9,13 @@ * @author Antoine Musso * @copyright Copyright © 2011, Antoine Musso * @file - * @todo covers tags * * @group Database */ +/** + * @covers Parser::getVariableValue + */ class MagicVariableTest extends MediaWikiTestCase { /** * @var Parser diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index af03fe6325..dceaf418f1 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -188,6 +188,7 @@ class SideBarTest extends MediaWikiLangTestCase { /** * Test $wgNoFollowLinks in sidebar + * @covers Skin::addToSidebarPlain */ public function testRespectWgnofollowlinks() { $this->setMwGlobals( 'wgNoFollowLinks', false ); @@ -201,6 +202,7 @@ class SideBarTest extends MediaWikiLangTestCase { /** * Test $wgExternaLinkTarget in sidebar * @dataProvider dataRespectExternallinktarget + * @covers Skin::addToSidebarPlain */ public function testRespectExternallinktarget( $externalLinkTarget ) { $this->setMwGlobals( 'wgExternalLinkTarget', $externalLinkTarget ); -- 2.20.1