diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-07-28 11:52:48 +0200 |
commit | 222b01f5169f1c7e69762e0e8904c24f78f71882 (patch) | |
tree | 8e932e12546bb991357ec48eb1638d1770be7a35 /tests/MediaWiki_TestCase.php | |
parent | 00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff) |
update to MediaWiki 1.16.0
Diffstat (limited to 'tests/MediaWiki_TestCase.php')
-rw-r--r-- | tests/MediaWiki_TestCase.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tests/MediaWiki_TestCase.php b/tests/MediaWiki_TestCase.php deleted file mode 100644 index 387fe011..00000000 --- a/tests/MediaWiki_TestCase.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -abstract class MediaWiki_TestCase extends PHPUnit_Framework_TestCase { - /** - * @param string $serverType - * @param array $tables - */ - protected function buildTestDatabase( $tables ) { - global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; - $wgDBprefix = 'parsertest_'; - $db = new Database( - $wgDBserver, - $wgDBadminuser, - $wgDBadminpassword, - $wgDBname ); - if( $db->isOpen() ) { - if (!(strcmp($db->getServerVersion(), '4.1') < 0 and stristr($db->getSoftwareLink(), 'MySQL'))) { - # Database that supports CREATE TABLE ... LIKE - foreach ($tables as $tbl) { - $newTableName = $db->tableName( $tbl ); - #$tableName = $this->oldTableNames[$tbl]; - $tableName = $tbl; - $db->query("CREATE TEMPORARY TABLE $newTableName (LIKE $tableName)"); - } - } else { - # Hack for MySQL versions < 4.1, which don't support - # "CREATE TABLE ... LIKE". Note that - # "CREATE TEMPORARY TABLE ... SELECT * FROM ... LIMIT 0" - # would not create the indexes we need.... - foreach ($tables as $tbl) { - $res = $db->query("SHOW CREATE TABLE $tbl"); - $row = $db->fetchRow($res); - $create = $row[1]; - $create_tmp = preg_replace('/CREATE TABLE `(.*?)`/', 'CREATE TEMPORARY TABLE `' - . $wgDBprefix . '\\1`', $create); - if ($create === $create_tmp) { - # Couldn't do replacement - wfDie( "could not create temporary table $tbl" ); - } - $db->query($create_tmp); - } - - } - return $db; - } else { - // Something amiss - return null; - } - } -} - |