From: Kunal Mehta Date: Mon, 25 Dec 2017 01:08:48 +0000 (-0800) Subject: Add @covers tags to ContentHandler tests X-Git-Tag: 1.31.0-rc.0~1078 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=4de7b0a5424cb5d0a712eb177cfa35e170626714 Add @covers tags to ContentHandler tests Change-Id: I4d0994e91f63a0921343f34ef81a82463b4ab969 --- diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index 1bd2eb04af..1462c3627e 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -332,7 +332,9 @@ class ContentHandlerTest extends MediaWikiTestCase { } } - /* + /** + * @covers ContentHandler::getAutosummary + * * Test if we become a "Created blank page" summary from getAutoSummary if no Content added to * page. */ @@ -374,11 +376,17 @@ class ContentHandlerTest extends MediaWikiTestCase { } */ + /** + * @covers ContentHandler::supportsCategories + */ public function testSupportsCategories() { $handler = new DummyContentHandlerForTesting( CONTENT_MODEL_WIKITEXT ); $this->assertTrue( $handler->supportsCategories(), 'content model supports categories' ); } + /** + * @covers ContentHandler::supportsDirectEditing + */ public function testSupportsDirectEditing() { $handler = new DummyContentHandlerForTesting( CONTENT_MODEL_JSON ); $this->assertFalse( $handler->supportsDirectEditing(), 'direct editing is not supported' ); @@ -407,6 +415,7 @@ class ContentHandlerTest extends MediaWikiTestCase { } /** + * @covers ContentHandler::getForModelID * @dataProvider provideGetModelForID */ public function testGetModelForID( $modelId, $handlerClass ) { @@ -415,6 +424,9 @@ class ContentHandlerTest extends MediaWikiTestCase { $this->assertInstanceOf( $handlerClass, $handler ); } + /** + * @covers ContentHandler::getFieldsForSearchIndex + */ public function testGetFieldsForSearchIndex() { $searchEngine = $this->newSearchEngine(); diff --git a/tests/phpunit/includes/content/CssContentTest.php b/tests/phpunit/includes/content/CssContentTest.php index d2078d7a23..1e82fdd4d3 100644 --- a/tests/phpunit/includes/content/CssContentTest.php +++ b/tests/phpunit/includes/content/CssContentTest.php @@ -83,6 +83,7 @@ class CssContentTest extends JavaScriptContentTest { } /** + * @covers CssContent::getRedirectTarget * @dataProvider provideGetRedirectTarget */ public function testGetRedirectTarget( $title, $text ) { diff --git a/tests/phpunit/includes/content/FileContentHandlerTest.php b/tests/phpunit/includes/content/FileContentHandlerTest.php index 65efcc9e80..ad9d41958c 100644 --- a/tests/phpunit/includes/content/FileContentHandlerTest.php +++ b/tests/phpunit/includes/content/FileContentHandlerTest.php @@ -2,6 +2,8 @@ /** * @group ContentHandler + * + * @covers FileContentHandler */ class FileContentHandlerTest extends MediaWikiLangTestCase { /** diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index 1c746bcdda..434e17cfb4 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -294,6 +294,7 @@ class JavaScriptContentTest extends TextContentTest { } /** + * @covers JavaScriptContent::getRedirectTarget * @dataProvider provideGetRedirectTarget */ public function testGetRedirectTarget( $title, $text ) { diff --git a/tests/phpunit/includes/content/TextContentHandlerTest.php b/tests/phpunit/includes/content/TextContentHandlerTest.php index 7d9f74eca0..a85215bea4 100644 --- a/tests/phpunit/includes/content/TextContentHandlerTest.php +++ b/tests/phpunit/includes/content/TextContentHandlerTest.php @@ -4,6 +4,9 @@ * @group ContentHandler */ class TextContentHandlerTest extends MediaWikiLangTestCase { + /** + * @covers TextContentHandler::supportsDirectEditing + */ public function testSupportsDirectEditing() { $handler = new TextContentHandler(); $this->assertTrue( $handler->supportsDirectEditing(), 'direct editing is supported' ); diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index 77cfb92bbc..02f82f4dac 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -115,6 +115,9 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { $this->assertEquals( $supported, $this->handler->isSupportedFormat( $format ) ); } + /** + * @covers WikitextContentHandler::supportsDirectEditing + */ public function testSupportsDirectEditing() { $handler = new WikiTextContentHandler(); $this->assertTrue( $handler->supportsDirectEditing(), 'direct editing is supported' ); @@ -349,6 +352,9 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { } */ + /** + * @covers WikitextContentHandler::getDataForSearchIndex + */ public function testDataIndexFieldsFile() { $mockEngine = $this->createMock( 'SearchEngine' ); $title = Title::newFromText( 'Somefile.jpg', NS_FILE ); diff --git a/tests/phpunit/includes/content/WikitextStructureTest.php b/tests/phpunit/includes/content/WikitextStructureTest.php index f1b54f6abe..1bdbe0157b 100644 --- a/tests/phpunit/includes/content/WikitextStructureTest.php +++ b/tests/phpunit/includes/content/WikitextStructureTest.php @@ -1,5 +1,8 @@