+++ /dev/null
-<?php
-
-require_once( dirname( __FILE__ ) . '/SearchEngineTest.php' );
-
-/**
- * @group Search
- * @group Database
- * @group Destructive
- */
-class SearchDbTest extends SearchEngineTest {
- var $db;
-
- function setUp() {
- // Get a database connection or skip test
- $this->db = wfGetDB( DB_MASTER );
- if ( !$this->db ) {
- $this->markTestIncomplete( "Can't find a database to test with." );
- }
-
- parent::setup();
-
- // Initialize search database with data
- $GLOBALS['wgContLang'] = new Language;
- $this->insertSearchData();
- $searchType = $this->db->getSearchEngine();
- $this->search = new $searchType( $this->db );
- }
-
- function tearDown() {
- $this->removeSearchData();
- unset( $this->search );
- }
-}
-
-
/**
* This class is not directly tested. Instead it is extended by SearchDbTest.
* @group Search
- * @group Stub
- * @group Destructive
+ * @group Database
*/
class SearchEngineTest extends MediaWikiTestCase {
- var $db, $search, $pageList;
+ protected $search, $pageList;
+
+ function tearDown() {
+ unset( $this->search );
+ }
/*
* Checks for database type & version.
* Will skip current test if DB does not support search.
*/
function setUp() {
+ parent::setUp();
// Search tests require MySQL or SQLite with FTS
# Get database type and version
$dbType = $this->db->getType();
if( !$dbSupported ) {
$this->markTestSkipped( "MySQL or SQLite with FTS3 only" );
}
+
+ $searchType = $this->db->getSearchEngine();
+ $this->search = new $searchType( $this->db );
}
function pageExists( $title ) {
return false;
}
- function insertSearchData() {
+ function addDBData() {
if ( $this->pageExists( 'Not_Main_Page' ) ) {
return;
}
$this->insertPage( 'DomainName', 'example.com', 0 );
}
- function removeSearchData() {
- return;
- /*while ( count( $this->pageList ) ) {
- list( $title, $id ) = array_pop( $this->pageList );
- $article = new Article( $title, $id );
- $article->doDeleteArticle( "Search Test" );
- }*/
- }
-
function fetchIds( $results ) {
$this->assertTrue( is_object( $results ) );