From ba01a1c59148615fa64f1f096d172ee1a14d8f04 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 27 Aug 2008 09:25:31 +0000 Subject: [PATCH] Patch by Shlomi Fish to fix this test --- t/Search.inc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/t/Search.inc b/t/Search.inc index fa8a8b9764..252293065a 100644 --- a/t/Search.inc +++ b/t/Search.inc @@ -14,19 +14,15 @@ function buildTestDatabase( $tables ) { global $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname, $wgDBtype; $oldPrefix = $wgDBprefix; $wgDBprefix = 'parsertest'; - $class = 'Database' . ucfirst( $wgDBtype ); - $db = new $class ( - $wgDBserver, - $wgDBadminuser, - $wgDBadminpassword, - $wgDBname ); + + $db = wfGetDB ( DB_SLAVE ); + if( $db->isOpen() ) { if ( !( stristr( $db->getSoftwareLink(), 'MySQL') && version_compare( $db->getServerVersion(), '4.1', '<' ) ) ) { # Database that supports CREATE TABLE ... LIKE foreach ($tables as $tbl) { $newTableName = $db->tableName( $tbl ); - #$tableName = $oldPrefix . $tbl; - $tableName = $tbl; + $tableName = $oldPrefix . $tbl; $db->query("CREATE TEMPORARY TABLE $newTableName (LIKE $tableName)"); } } else { @@ -162,4 +158,4 @@ END $got = $this->fetchIds( $this->search->searchTitle( 'smithee' ) ); is( $got, $exp, "Title power search" ); } -} \ No newline at end of file +} -- 2.20.1