mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/10678] More formatting and docblocks
PHPBB3-10678
This commit is contained in:
parent
0a596c4b8c
commit
9bb2785da0
@ -32,7 +32,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
|||||||
{
|
{
|
||||||
$db_config = $this->get_database_config();
|
$db_config = $this->get_database_config();
|
||||||
|
|
||||||
//Firebird requires table and column names to be uppercase
|
// Firebird requires table and column names to be uppercase
|
||||||
if ($db_config['dbms'] == 'firebird')
|
if ($db_config['dbms'] == 'firebird')
|
||||||
{
|
{
|
||||||
$xml_data = file_get_contents($path);
|
$xml_data = file_get_contents($path);
|
||||||
@ -129,6 +129,14 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
|||||||
return new phpbb_database_test_connection_manager($config);
|
return new phpbb_database_test_connection_manager($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a match in the middle of a string to uppercase.
|
||||||
|
* This is necessary for tranforming 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
|
||||||
|
*/
|
||||||
public static function to_upper($matches)
|
public static function to_upper($matches)
|
||||||
{
|
{
|
||||||
return $matches[1] . strtoupper($matches[2]) . $matches[3];
|
return $matches[1] . strtoupper($matches[2]) . $matches[3];
|
||||||
|
@ -84,8 +84,8 @@ class phpbb_database_test_connection_manager
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//These require different connection strings on the phpBB side than they do in PDO
|
// These require different connection strings on the phpBB side than they do in PDO
|
||||||
//so you must provide a DSN string for ODBC separately
|
// so you must provide a DSN string for ODBC separately
|
||||||
if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'mssql' || $this->config['dbms'] == 'firebird'))
|
if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'mssql' || $this->config['dbms'] == 'firebird'))
|
||||||
{
|
{
|
||||||
$dsn = 'odbc:' . $this->config['custom_dsn'];
|
$dsn = 'odbc:' . $this->config['custom_dsn'];
|
||||||
@ -106,7 +106,7 @@ class phpbb_database_test_connection_manager
|
|||||||
$this->pdo = new phpbb_database_connection_ODBC_PDO_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
$this->pdo = new phpbb_database_connection_ODBC_PDO_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Fall through if they're using the firebird PDO driver and not the generic ODBC driver
|
// Fall through if they're using the firebird PDO driver and not the generic ODBC driver
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
$this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user