/**
* @group Search
* @group Database
+ *
+ * @covers SearchEngine<extended>
+ * @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.
}
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;
}
# sort them numerically so we will compare simply that we received
# the expected matches.
sort( $matches );
+
return $matches;
}
return true;
}
- function testFullWidth() {
+ public function testFullWidth() {
$this->assertEquals(
array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ),
$this->fetchIds( $this->search->searchText( 'AZ' ) ),
"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(
"Power search failed" );
}
- function testTitleSearch() {
+ public function testTitleSearch() {
$this->assertEquals(
array(
'Alan Smithee',
"Title search failed" );
}
- function testTextTitlePowerSearch() {
+ public function testTextTitlePowerSearch() {
$this->search->setNamespaces( array( 0, 1, 4 ) );
$this->assertEquals(
array(
$this->fetchIds( $this->search->searchTitle( 'smithee' ) ),
"Title power search failed" );
}
-
}