X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsearch%2FSearchEngineTest.php;h=e4605911f004090a9d85730f282f780ea4318907;hb=aea1b27db02bdf9b60789d55db320792b7cbe2dd;hp=6abca6d4a1cf2d0d62717c430f7aa014d00dd149;hpb=4777e3f3c400633e77d6eed11bc8c38abfada94a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php index 6abca6d4a1..e4605911f0 100644 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ b/tests/phpunit/includes/search/SearchEngineTest.php @@ -3,9 +3,16 @@ /** * @group Search * @group Database + * + * @covers SearchEngine + * @note Coverage will only ever show one of on of the Search* classes */ class SearchEngineTest extends MediaWikiLangTestCase { - protected $search, $pageList; + /** + * @var SearchEngine + */ + protected $search; + protected $pageList; /** * Checks for database type & version. @@ -45,7 +52,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { } if ( !$this->isWikitextNS( NS_MAIN ) ) { - //@todo: cover the case of non-wikitext content in the main namespace + // @todo cover the case of non-wikitext content in the main namespace return; } @@ -87,6 +94,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { # sort them numerically so we will compare simply that we received # the expected matches. sort( $matches ); + return $matches; } @@ -114,7 +122,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { return true; } - function testFullWidth() { + public function testFullWidth() { $this->assertEquals( array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), $this->fetchIds( $this->search->searchText( 'AZ' ) ), @@ -133,14 +141,14 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Search for normalized from Full-width Lower" ); } - function testTextSearch() { + public function testTextSearch() { $this->assertEquals( array( 'Smithee' ), $this->fetchIds( $this->search->searchText( 'smithee' ) ), "Plain search failed" ); } - function testTextPowerSearch() { + public function testTextPowerSearch() { $this->search->setNamespaces( array( 0, 1, 4 ) ); $this->assertEquals( array( @@ -151,7 +159,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Power search failed" ); } - function testTitleSearch() { + public function testTitleSearch() { $this->assertEquals( array( 'Alan Smithee', @@ -161,7 +169,7 @@ class SearchEngineTest extends MediaWikiLangTestCase { "Title search failed" ); } - function testTextTitlePowerSearch() { + public function testTextTitlePowerSearch() { $this->search->setNamespaces( array( 0, 1, 4 ) ); $this->assertEquals( array( @@ -172,5 +180,4 @@ class SearchEngineTest extends MediaWikiLangTestCase { $this->fetchIds( $this->search->searchTitle( 'smithee' ) ), "Title power search failed" ); } - }