Add @covers tags for more tests
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 29 Dec 2017 23:44:13 +0000 (15:44 -0800)
committerLegoktm <legoktm@member.fsf.org>
Tue, 2 Jan 2018 11:52:42 +0000 (11:52 +0000)
Change-Id: If2254b3a9e61e056091779a1ea14237aa7b42eb6

tests/phpunit/includes/FauxRequestTest.php
tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
tests/phpunit/includes/libs/DeferredStringifierTest.php
tests/phpunit/includes/libs/DnsSrvDiscovererTest.php
tests/phpunit/includes/libs/IPTest.php
tests/phpunit/includes/libs/ProcessCacheLRUTest.php
tests/phpunit/includes/libs/SamplingStatsdClientTest.php
tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
tests/phpunit/includes/utils/AvroValidatorTest.php
tests/phpunit/includes/utils/MWCryptHashTest.php

index 9fe694d..013ced3 100644 (file)
@@ -39,13 +39,19 @@ class FauxRequestTest extends PHPUnit_Framework_TestCase {
                $this->assertEquals( '', $req->getText( 'z' ) );
        }
 
-       // Integration test for parent method.
+       /**
+        * Integration test for parent method
+        * @covers FauxRequest::getVal
+        */
        public function testGetVal() {
                $req = new FauxRequest( [ 'crlf' => "A\r\nb" ] );
                $this->assertSame( "A\r\nb", $req->getVal( 'crlf' ), 'CRLF' );
        }
 
-       // Integration test for parent method.
+       /**
+        * Integration test for parent method
+        * @covers FauxRequest::getRawVal
+        */
        public function testGetRawVal() {
                $req = new FauxRequest( [
                        'x' => 'Value',
index 9ec4f97..57e8654 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+/**
+ * @covers HTMLRestrictionsField
+ */
 class HTMLRestrictionsFieldTest extends PHPUnit_Framework_TestCase {
        public function testConstruct() {
                $field = new HTMLRestrictionsField( [ 'fieldname' => 'restrictions' ] );
index cba2939..82f24f7 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 
+/**
+ * @covers DeferredStringifier
+ */
 class DeferredStringifierTest extends PHPUnit_Framework_TestCase {
 
        /**
-        * @covers DeferredStringifier
         * @dataProvider provideToString
         */
        public function testToString( $params, $expected ) {
index cfc2d91..52316f3 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
+/**
+ * @covers DnsSrvDiscoverer
+ */
 class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase {
        /**
-        * @covers DnsSrvDiscoverer
         * @dataProvider provideRecords
         */
        public function testPickServer( $params, $expected ) {
index e47c4ba..9d3bd29 100644 (file)
@@ -561,7 +561,7 @@ class IPTest extends PHPUnit_Framework_TestCase {
        }
 
        /**
-        * Test for IP::splitHostAndPort().
+        * @covers IP::splitHostAndPort()
         * @dataProvider provideSplitHostAndPort
         */
        public function testSplitHostAndPort( $expected, $input, $description ) {
@@ -588,7 +588,7 @@ class IPTest extends PHPUnit_Framework_TestCase {
        }
 
        /**
-        * Test for IP::combineHostAndPort()
+        * @covers IP::combineHostAndPort()
         * @dataProvider provideCombineHostAndPort
         */
        public function testCombineHostAndPort( $expected, $input, $description ) {
@@ -612,7 +612,7 @@ class IPTest extends PHPUnit_Framework_TestCase {
        }
 
        /**
-        * Test for IP::sanitizeRange()
+        * @covers IP::sanitizeRange()
         * @dataProvider provideIPCIDRs
         */
        public function testSanitizeRange( $input, $expected, $description ) {
@@ -636,7 +636,7 @@ class IPTest extends PHPUnit_Framework_TestCase {
        }
 
        /**
-        * Test for IP::prettifyIP()
+        * @covers IP::prettifyIP()
         * @dataProvider provideIPsToPrettify
         */
        public function testPrettifyIP( $ip, $prettified ) {
index 9c189d1..e9b2764 100644 (file)
@@ -58,6 +58,7 @@ class ProcessCacheLRUTest extends PHPUnit_Framework_TestCase {
 
        /**
         * Highlight diff between assertEquals and assertNotSame
+        * @coversNothing
         */
        public function testPhpUnitArrayEquality() {
                $one = [ 'A' => 1, 'B' => 2 ];
index c5bc03e..3439df8 100644 (file)
@@ -3,6 +3,9 @@
 use Liuggio\StatsdClient\Entity\StatsdData;
 use Liuggio\StatsdClient\Sender\SenderInterface;
 
+/**
+ * @covers SamplingStatsdClient
+ */
 class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
        /**
         * @dataProvider samplingDataProvider
index b6ea426..e6ccb34 100644 (file)
@@ -3,6 +3,9 @@
 use Wikimedia\Rdbms\TransactionProfiler;
 use Psr\Log\LoggerInterface;
 
+/**
+ * @covers \Wikimedia\Rdbms\TransactionProfiler
+ */
 class TransactionProfilerTest extends PHPUnit_Framework_TestCase {
        public function testAffected() {
                $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
index 7559e22..4fccd3e 100644 (file)
@@ -9,6 +9,9 @@
  * dataprovider.
  */
 
+/**
+ * @covers AvroValidator
+ */
 class AvroValidatorTest extends PHPUnit_Framework_TestCase {
        public function setUp() {
                if ( !class_exists( 'AvroSchema' ) ) {
index 905d14c..7ea229d 100644 (file)
@@ -1,9 +1,10 @@
 <?php
+
 /**
- *
  * @group Hash
+ *
+ * @covers MWCryptHash
  */
-
 class MWCryptHashTest extends PHPUnit_Framework_TestCase {
 
        public function testHashLength() {