aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-09-10 17:45:28 +0200
committerNils Adermann <naderman@naderman.de>2013-09-16 00:41:44 +0200
commitbdaf68c113162a98a2e471183a39297e1a965ad3 (patch)
tree6545d9323290620a7703d1edb1d6d8539586b239 /tests
parentd297eb4aecc6e658987c9647d76fed4210ef77f5 (diff)
downloadforums-bdaf68c113162a98a2e471183a39297e1a965ad3.tar
forums-bdaf68c113162a98a2e471183a39297e1a965ad3.tar.gz
forums-bdaf68c113162a98a2e471183a39297e1a965ad3.tar.bz2
forums-bdaf68c113162a98a2e471183a39297e1a965ad3.tar.xz
forums-bdaf68c113162a98a2e471183a39297e1a965ad3.zip
[ticket/11700] Don't prefix dbms classnames with \
PHPBB3-11700
Diffstat (limited to 'tests')
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php2
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php74
2 files changed, 38 insertions, 38 deletions
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
index 95fa226f42..4d210d7b29 100644
--- a/tests/functions/convert_30_dbms_to_31_test.php
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -31,7 +31,7 @@ class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
*/
public function test_convert_30_dbms_to_31($input)
{
- $expected = "\\phpbb\\db\\driver\\$input";
+ $expected = "phpbb\\db\\driver\\$input";
$output = phpbb_convert_30_dbms_to_31($input);
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 1a31fb13d0..b6ba4e0c8c 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -108,7 +108,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' || $this->config['dbms'] == 'phpbb\db\driver\firebird'))
{
$dsn = 'odbc:' . $this->config['custom_dsn'];
}
@@ -117,12 +117,12 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\mssql':
- case '\phpbb\db\driver\mssql_odbc':
+ case 'phpbb\db\driver\mssql':
+ case 'phpbb\db\driver\mssql_odbc':
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
- case '\phpbb\db\driver\firebird':
+ 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']);
@@ -145,8 +145,8 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\mysql':
- case '\phpbb\db\driver\mysqli':
+ case 'phpbb\db\driver\mysql':
+ case 'phpbb\db\driver\mysqli':
$this->pdo->exec('SET NAMES utf8');
/*
@@ -187,8 +187,8 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\sqlite':
- case '\phpbb\db\driver\firebird':
+ case 'phpbb\db\driver\sqlite':
+ case 'phpbb\db\driver\firebird':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -198,7 +198,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case '\phpbb\db\driver\oracle':
+ case 'phpbb\db\driver\oracle':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -208,7 +208,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case '\phpbb\db\driver\postgres':
+ case 'phpbb\db\driver\postgres':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -258,38 +258,38 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\mysql':
- case '\phpbb\db\driver\mysqli':
+ case 'phpbb\db\driver\mysql':
+ case 'phpbb\db\driver\mysqli':
$sql = 'SHOW TABLES';
break;
- case '\phpbb\db\driver\sqlite':
+ case 'phpbb\db\driver\sqlite':
$sql = 'SELECT name
FROM sqlite_master
WHERE type = "table"';
break;
- case '\phpbb\db\driver\mssql':
- case '\phpbb\db\driver\mssql_odbc':
- case '\phpbb\db\driver\mssqlnative':
+ case 'phpbb\db\driver\mssql':
+ case 'phpbb\db\driver\mssql_odbc':
+ case 'phpbb\db\driver\mssqlnative':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
break;
- case '\phpbb\db\driver\postgres':
+ case 'phpbb\db\driver\postgres':
$sql = 'SELECT relname
FROM pg_stat_user_tables';
break;
- case '\phpbb\db\driver\firebird':
+ 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':
+ case 'phpbb\db\driver\oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
break;
@@ -325,7 +325,7 @@ class phpbb_database_test_connection_manager
{
$schema = $this->dbms['SCHEMA'];
- if ($this->config['dbms'] == '\phpbb\db\driver\mysql')
+ if ($this->config['dbms'] == 'phpbb\db\driver\mysql')
{
$sth = $this->pdo->query('SELECT VERSION() AS version');
$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -359,47 +359,47 @@ class phpbb_database_test_connection_manager
protected function get_dbms_data($dbms)
{
$available_dbms = array(
- '\phpbb\db\driver\firebird' => array(
+ 'phpbb\db\driver\firebird' => array(
'SCHEMA' => 'firebird',
'DELIM' => ';;',
'PDO' => 'firebird',
),
- '\phpbb\db\driver\mysqli' => array(
+ 'phpbb\db\driver\mysqli' => array(
'SCHEMA' => 'mysql_41',
'DELIM' => ';',
'PDO' => 'mysql',
),
- '\phpbb\db\driver\mysql' => array(
+ 'phpbb\db\driver\mysql' => array(
'SCHEMA' => 'mysql',
'DELIM' => ';',
'PDO' => 'mysql',
),
- '\phpbb\db\driver\mssql' => array(
+ 'phpbb\db\driver\mssql' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- '\phpbb\db\driver\mssql_odbc'=> array(
+ 'phpbb\db\driver\mssql_odbc'=> array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- '\phpbb\db\driver\mssqlnative' => array(
+ 'phpbb\db\driver\mssqlnative' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'sqlsrv',
),
- '\phpbb\db\driver\oracle' => array(
+ 'phpbb\db\driver\oracle' => array(
'SCHEMA' => 'oracle',
'DELIM' => '/',
'PDO' => 'oci',
),
- '\phpbb\db\driver\postgres' => array(
+ 'phpbb\db\driver\postgres' => array(
'SCHEMA' => 'postgres',
'DELIM' => ';',
'PDO' => 'pgsql',
),
- '\phpbb\db\driver\sqlite' => array(
+ 'phpbb\db\driver\sqlite' => array(
'SCHEMA' => 'sqlite',
'DELIM' => ';',
'PDO' => 'sqlite2',
@@ -428,7 +428,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\firebird':
+ case 'phpbb\db\driver\firebird':
$sql = 'SELECT RDB$GENERATOR_NAME
FROM RDB$GENERATORS
WHERE RDB$SYSTEM_FLAG = 0';
@@ -440,7 +440,7 @@ class phpbb_database_test_connection_manager
}
break;
- case '\phpbb\db\driver\oracle':
+ case 'phpbb\db\driver\oracle':
$sql = 'SELECT sequence_name
FROM USER_SEQUENCES';
$result = $this->pdo->query($sql);
@@ -451,7 +451,7 @@ class phpbb_database_test_connection_manager
}
break;
- case '\phpbb\db\driver\postgres':
+ case 'phpbb\db\driver\postgres':
$sql = 'SELECT sequence_name
FROM information_schema.sequences';
$result = $this->pdo->query($sql);
@@ -509,7 +509,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case '\phpbb\db\driver\oracle':
+ case 'phpbb\db\driver\oracle':
// Get all of the information about the sequences
$sql = "SELECT t.table_name, tc.column_name, d.referenced_name as sequence_name, s.increment_by, s.min_value
FROM USER_TRIGGERS t
@@ -544,14 +544,14 @@ class phpbb_database_test_connection_manager
* Since we have no objects attached to our sequencers (triggers aren't attached), this works fine.
*/
$queries[] = 'DROP SEQUENCE ' . $row['SEQUENCE_NAME'];
- $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']}
- MINVALUE {$row['MIN_VALUE']}
- INCREMENT BY {$row['INCREMENT_BY']}
+ $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']}
+ MINVALUE {$row['MIN_VALUE']}
+ INCREMENT BY {$row['INCREMENT_BY']}
START WITH $max_val";
}
break;
- case '\phpbb\db\driver\postgres':
+ case 'phpbb\db\driver\postgres':
// Get the sequences attached to the tables
$sql = 'SELECT column_name, table_name FROM information_schema.columns
WHERE table_name IN (' . implode(', ', $table_names) . ")