phpunit: Add some @covers and @large/@medium to integration tests
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 20 Mar 2018 16:14:34 +0000 (09:14 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 20 Mar 2018 16:14:34 +0000 (09:14 -0700)
- @small: single class, no I/O (unit test).
- @medium: multi-class (partial or no mocks), no I/O (unit/integration test).
- @large: multi-class, I/O allowed (integration test).

Change-Id: I09317e6dd9b0ee34b7467fbffdd07957ef55dc04

tests/integration/includes/http/CurlHttpRequestTest.php
tests/integration/includes/http/PhpHttpRequestTest.php
tests/integration/includes/shell/FirejailCommandTest.php
tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php
tests/phpunit/includes/http/HttpTest.php
tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php
tests/phpunit/includes/parser/ParserIntegrationTest.php
tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php

index 04f80f4..48a78d3 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @large
+ * @covers CurlHttpRequest
+ */
 class CurlHttpRequestTest extends MWHttpRequestTestCase {
        protected static $httpEngine = 'curl';
 }
index d0222a5..90bf532 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @large
+ * @covers PhpHttpRequest
+ */
 class PhpHttpRequestTest extends MWHttpRequestTestCase {
        protected static $httpEngine = 'php';
 }
index c69fa73..9ee157b 100644 (file)
@@ -7,7 +7,10 @@ use MediaWiki\Shell\Shell;
  * Integration tests to ensure that firejail actually prevents execution.
  * Meant to run on vagrant, although will probably work on other setups
  * as long as firejail and sudo has similar config.
+ *
+ * @large
  * @group Shell
+ * @covers FirejailCommand
  */
 class FirejailCommandIntegrationTest extends PHPUnit\Framework\TestCase {
 
index 8919c5e..8417f5c 100644 (file)
@@ -4,9 +4,9 @@ use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
 
 /**
+ * @medium
  * @group API
  * @group Database
- * @group medium
  *
  * @covers ApiQueryWatchlist
  */
index 1e685bd..f80d18c 100644 (file)
@@ -2,6 +2,7 @@
 
 /**
  * @group Http
+ * @group small
  */
 class HttpTest extends MediaWikiTestCase {
        /**
index 076924c..97ea326 100644 (file)
@@ -5,8 +5,10 @@ use MediaWiki\MediaWikiServices;
  * Integration test that checks import success and
  * LinkCache integration.
  *
- * @group medium
+ * @large
  * @group Database
+ * @covers ImportStreamSource
+ * @covers ImportReporter
  *
  * @author mwjames
  */
index 0e1605a..c25329f 100644 (file)
@@ -8,6 +8,7 @@ use Wikimedia\ScopedCallback;
  * Note: the following groups are not used by PHPUnit.
  * The list in ParserTestFileSuite::__construct() is used instead.
  *
+ * @large
  * @group Database
  * @group Parser
  * @group ParserTests
index fdf0152..edc2eff 100644 (file)
@@ -1,7 +1,13 @@
 <?php
 
 /**
+ * @medium
  * @group Database
+ * @covers FormattedRCFeed
+ * @covers RecentChange
+ * @covers JSONRCFeedFormatter
+ * @covers MachineReadableRCFeedFormatter
+ * @covers RCFeed
  */
 class RCFeedIntegrationTest extends MediaWikiTestCase {
        protected function setUp() {
@@ -17,15 +23,6 @@ class RCFeedIntegrationTest extends MediaWikiTestCase {
                ] );
        }
 
-       /**
-        * @covers RecentChange::notifyRCFeeds
-        * @covers RecentChange::getEngine
-        * @covers RCFeed::factory
-        * @covers FormattedRCFeed::__construct
-        * @covers FormattedRCFeed::notify
-        * @covers JSONRCFeedFormatter::formatArray
-        * @covers MachineReadableRCFeedFormatter::getLine
-        */
        public function testNotify() {
                $feed = $this->getMockBuilder( RCFeedEngine::class )
                        ->setConstructorArgs( [ [ 'formatter' => JSONRCFeedFormatter::class ] ] )