* Fix search-replace problems in MediaWiki_Setup.php
[lhc/web/wiklou.git] / maintenance / tests / SearchDbTest.php
1 <?php
2 require_once( 'SearchEngineTest.php' );
3
4 class SearchDbTest extends SearchEngineTest {
5 var $db;
6
7 function setUp() {
8 global $wgDBprefix, $wgDBtype;
9
10 if($wgDBprefix === "parsertest_" ||
11 ($wgDBtype === 'oracle' && $wgDBprefix === 'pt_')) {
12 $this->markTestSkipped("This test can't (yet?) be run with the parser tests");
13 }
14
15 $GLOBALS['wgContLang'] = new Language;
16 $this->db = $this->buildTestDatabase(
17 array( 'page', 'revision', 'text', 'searchindex', 'user' ) );
18 if( $this->db ) {
19 $this->insertSearchData();
20 }
21 $searchType = preg_replace("/Database/", "Search", get_class($this->db));
22 $this->search = new $searchType( $this->db );
23 }
24
25 function tearDown() {
26 if( !is_null( $this->db ) ) {
27 wfGetLB()->closeConnecton( $this->db );
28 }
29 unset( $this->db );
30 unset( $this->search );
31 }
32 }
33
34