* Removed require/require_once from maintenance scripts where possible, replaced...
[lhc/web/wiklou.git] / maintenance / tests / SearchDbTest.php
1 <?php
2 class SearchDbTest extends SearchEngineTest {
3 var $db;
4
5 function setUp() {
6 global $wgDBprefix, $wgDBtype;
7 $this->db = wfGetDB( DB_MASTER );
8 if ( !$this->db ) {
9 $this->markTestIncomplete( "Can't find a database to test with." );
10 }
11
12 $GLOBALS['wgContLang'] = new Language;
13 $this->insertSearchData();
14
15 $this->insertSearchData();
16 $searchType = preg_replace( "/Database/", "Search",
17 get_class( $this->db ) );
18 $this->search = new $searchType( $this->db );
19 }
20
21 function tearDown() {
22 $this->removeSearchData();
23 if ( !is_null( $this->db ) ) {
24 wfGetLB()->closeConnecton( $this->db );
25 }
26 unset( $this->db );
27 unset( $this->search );
28 }
29 }
30
31