Patch by Shlomi Fish to fix this test
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 27 Aug 2008 09:25:31 +0000 (09:25 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 27 Aug 2008 09:25:31 +0000 (09:25 +0000)
t/Search.inc

index fa8a8b9..2522930 100644 (file)
@@ -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
+}