From ca1a101d97cf28c9b7b9d9ba6019e7564609204b Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 1 Feb 2019 21:57:58 +0100 Subject: [PATCH] Add missing @covers to search related tests Change-Id: Iba122ad763a5728a7ddb487b3d01d679de6845e5 --- tests/phpunit/includes/search/SearchEnginePrefixTest.php | 1 + tests/phpunit/includes/search/SearchSuggestionSetTest.php | 7 +++++++ tests/phpunit/includes/specials/SpecialSearchTest.php | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/tests/phpunit/includes/search/SearchEnginePrefixTest.php b/tests/phpunit/includes/search/SearchEnginePrefixTest.php index ee272b9b5d..372cb33cbb 100644 --- a/tests/phpunit/includes/search/SearchEnginePrefixTest.php +++ b/tests/phpunit/includes/search/SearchEnginePrefixTest.php @@ -382,6 +382,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase { /** * @dataProvider paginationProvider + * @covers SearchSuggestionSet::hasMoreResults */ public function testPagination( $hasMoreResults, $provision ) { $search = $this->mockSearchWithResults( $provision ); diff --git a/tests/phpunit/includes/search/SearchSuggestionSetTest.php b/tests/phpunit/includes/search/SearchSuggestionSetTest.php index 54533a7333..02fa5e9cac 100644 --- a/tests/phpunit/includes/search/SearchSuggestionSetTest.php +++ b/tests/phpunit/includes/search/SearchSuggestionSetTest.php @@ -23,6 +23,7 @@ class SearchSuggestionSetTest extends \PHPUnit\Framework\TestCase { /** * Test that adding a new suggestion at the end * will keep proper score ordering + * @covers SearchSuggestionSet::append */ public function testAppend() { $set = SearchSuggestionSet::emptySuggestionSet(); @@ -54,6 +55,9 @@ class SearchSuggestionSetTest extends \PHPUnit\Framework\TestCase { /** * Test that adding a new best suggestion will keep proper score * ordering + * @covers SearchSuggestionSet::getWorstScore + * @covers SearchSuggestionSet::getBestScore + * @covers SearchSuggestionSet::prepend */ public function testInsertBest() { $set = SearchSuggestionSet::emptySuggestionSet(); @@ -88,6 +92,9 @@ class SearchSuggestionSetTest extends \PHPUnit\Framework\TestCase { $this->assertEquals( $sorted, $scores ); } + /** + * @covers SearchSuggestionSet::shrink + */ public function testShrink() { $set = SearchSuggestionSet::emptySuggestionSet(); for ( $i = 0; $i < 100; $i++ ) { diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index 6ff2110ee3..1a4fe4f825 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -114,6 +114,7 @@ class SpecialSearchTest extends MediaWikiTestCase { /** * Verify we do not expand search term in on search result page * https://gerrit.wikimedia.org/r/4841 + * @covers SpecialSearch::setupPage */ public function testSearchTermIsNotExpanded() { $this->setMwGlobals( [ @@ -175,6 +176,7 @@ class SpecialSearchTest extends MediaWikiTestCase { /** * @dataProvider provideRewriteQueryWithSuggestion + * @covers SpecialSearch::showResults */ public function testRewriteQueryWithSuggestion( $message, @@ -224,6 +226,9 @@ class SpecialSearchTest extends MediaWikiTestCase { return $mock; } + /** + * @covers SpecialSearch::execute + */ public function testSubPageRedirect() { $this->setMwGlobals( [ 'wgScript' => '/w/index.php', -- 2.20.1