1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/12747] Remove some methods which are not used anymore
  [ticket/12747] Drop support for Firebird
This commit is contained in:
Andreas Fischer
2014-06-22 23:41:26 +02:00
26 changed files with 9 additions and 1165 deletions

View File

@@ -32,7 +32,6 @@ will be skipped:
- apc (APC cache driver)
- bz2 (compress tests)
- interbase, pdo_firebird (Firebird database driver)
- mysql, pdo_mysql (MySQL database driver)
- mysqli, pdo_mysql (MySQLi database driver)
- pcntl (flock class)
@@ -82,16 +81,10 @@ Special Database Cases
----------------------
In order to run tests on some of the databases that we support, it will be
necessary to provide a custom DSN string in test_config.php. This is only
needed for MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when
PDO_Firebird does not work on your system
(https://bugs.php.net/bug.php?id=61183). The variable must be named `$custom_dsn`.
needed for MSSQL 2000+ (PHP module) and MSSQL via ODBC. The variable must be
named `$custom_dsn`.
Examples:
Firebird using http://www.firebirdsql.org/en/odbc-driver/
$custom_dsn = "Driver={Firebird/InterBase(r) driver};dbname=$dbhost:$dbname";
MSSQL
Example MSSQL:
$custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname";

View File

@@ -18,7 +18,6 @@ class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
public function convert_30_dbms_to_31_data()
{
return array(
array('firebird'),
array('mssql'),
array('mssql_odbc'),
array('mssqlnative'),

View File

@@ -25,7 +25,7 @@ if (!class_exists('PDO'))
*/
class phpbb_database_connection_odbc_pdo_wrapper extends PDO
{
// Name of the driver being used (i.e. mssql, firebird)
// Name of the driver being used (i.e. mssql)
public $driver = '';
// Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this

View File

@@ -145,25 +145,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function createXMLDataSet($path)
{
$db_config = $this->get_database_config();
// Firebird requires table and column names to be uppercase
if ($db_config['dbms'] == 'phpbb\db\driver\firebird')
{
$xml_data = file_get_contents($path);
$xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data);
$xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
$new_fixture = tmpfile();
fwrite($new_fixture, $xml_data);
fseek($new_fixture, 0);
$meta_data = stream_get_meta_data($new_fixture);
$path = $meta_data['uri'];
}
$this->fixture_xml_data = parent::createXMLDataSet($path);
return $this->fixture_xml_data;
}
@@ -244,19 +226,6 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
return new phpbb_database_test_connection_manager($config);
}
/**
* Converts a match in the middle of a string to uppercase.
* This is necessary for transforming the fixture information for Firebird tests
*
* @param $matches The array of matches from a regular expression
*
* @return string The string with the specified match converted to uppercase
*/
static public function to_upper($matches)
{
return $matches[1] . strtoupper($matches[2]) . $matches[3];
}
public function assert_array_content_equals($one, $two)
{
// http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important

View File

@@ -116,7 +116,7 @@ class phpbb_database_test_connection_manager
// These require different connection strings on the phpBB side than they do in PDO
// so you must provide a DSN string for ODBC separately
if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'phpbb\db\driver\mssql' || $this->config['dbms'] == 'phpbb\db\driver\firebird'))
if (!empty($this->config['custom_dsn']) && $this->config['dbms'] == 'phpbb\db\driver\mssql')
{
$dsn = 'odbc:' . $this->config['custom_dsn'];
}
@@ -130,14 +130,6 @@ class phpbb_database_test_connection_manager
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
case 'phpbb\db\driver\firebird':
if (!empty($this->config['custom_dsn']))
{
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
}
// Fall through if they're using the firebird PDO driver and not the generic ODBC driver
default:
$this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
@@ -197,7 +189,6 @@ class phpbb_database_test_connection_manager
{
case 'phpbb\db\driver\sqlite':
case 'phpbb\db\driver\sqlite3':
case 'phpbb\db\driver\firebird':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -298,13 +289,6 @@ class phpbb_database_test_connection_manager
FROM pg_stat_user_tables';
break;
case 'phpbb\db\driver\firebird':
$sql = 'SELECT rdb$relation_name
FROM rdb$relations
WHERE rdb$view_source is null
AND rdb$system_flag = 0';
break;
case 'phpbb\db\driver\oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
@@ -404,11 +388,6 @@ class phpbb_database_test_connection_manager
protected function get_dbms_data($dbms)
{
$available_dbms = array(
'phpbb\db\driver\firebird' => array(
'SCHEMA' => 'firebird',
'DELIM' => ';;',
'PDO' => 'firebird',
),
'phpbb\db\driver\mysqli' => array(
'SCHEMA' => 'mysql_41',
'DELIM' => ';',
@@ -478,18 +457,6 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
case 'phpbb\db\driver\firebird':
$sql = 'SELECT RDB$GENERATOR_NAME
FROM RDB$GENERATORS
WHERE RDB$SYSTEM_FLAG = 0';
$result = $this->pdo->query($sql);
while ($row = $result->fetch(PDO::FETCH_NUM))
{
$queries[] = 'DROP GENERATOR ' . current($row);
}
break;
case 'phpbb\db\driver\oracle':
$sql = 'SELECT sequence_name
FROM USER_SEQUENCES';