diff --git a/tests/dbal/case_test.php b/tests/dbal/case_test.php index edab3525a1..57a1729a39 100644 --- a/tests/dbal/case_test.php +++ b/tests/dbal/case_test.php @@ -19,13 +19,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case $db = $this->new_dbal(); $sql = 'SELECT ' . $db->sql_case('1 = 1', '1', '2') . ' AS test_num - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query_limit($sql, 1); $this->assertEquals(1, (int) $db->sql_fetchfield('test_num')); $sql = 'SELECT ' . $db->sql_case('1 = 0', '1', '2') . ' AS test_num - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query_limit($sql, 1); $this->assertEquals(2, (int) $db->sql_fetchfield('test_num')); @@ -36,13 +36,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case $db = $this->new_dbal(); $sql = 'SELECT ' . $db->sql_case('1 = 1', "'foo'", "'bar'") . ' AS test_string - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query_limit($sql, 1); $this->assertEquals('foo', $db->sql_fetchfield('test_string')); $sql = 'SELECT ' . $db->sql_case('1 = 0', "'foo'", "'bar'") . ' AS test_string - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query_limit($sql, 1); $this->assertEquals('bar', $db->sql_fetchfield('test_string')); @@ -53,14 +53,14 @@ class phpbb_dbal_case_test extends phpbb_database_test_case $db = $this->new_dbal(); $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string - FROM \phpbb\config\config + FROM phpbb_config WHERE config_name = 'config1'"; $result = $db->sql_query_limit($sql, 1); $this->assertEquals('config1', $db->sql_fetchfield('test_string')); $sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string - FROM \phpbb\config\config + FROM phpbb_config WHERE config_value = 'bar'"; $result = $db->sql_query_limit($sql, 1); diff --git a/tests/dbal/concatenate_test.php b/tests/dbal/concatenate_test.php index 818bde7d23..0891fa58a0 100644 --- a/tests/dbal/concatenate_test.php +++ b/tests/dbal/concatenate_test.php @@ -19,7 +19,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case $db = $this->new_dbal(); $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', "'" . $db->sql_escape('append') . "'") . ' AS string - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query($sql); $db->sql_return_on_error(false); @@ -43,7 +43,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case $db = $this->new_dbal(); $sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', 'config_value') . ' AS string - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query($sql); $db->sql_return_on_error(false); diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php index 3f48f22252..041c529855 100644 --- a/tests/dbal/migration/dummy.php +++ b/tests/dbal/migration/dummy.php @@ -18,7 +18,7 @@ class phpbb_dbal_migration_dummy extends \phpbb\db\migration\migration { return array( 'add_columns' => array( - '\phpbb\config\config' => array( + 'phpbb_config' => array( 'extra_column' => array('UINT', 1), ), ), diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php index c46dfca30d..1882b20492 100644 --- a/tests/dbal/migration/revert.php +++ b/tests/dbal/migration/revert.php @@ -13,7 +13,7 @@ class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration { return array( 'add_columns' => array( - '\phpbb\config\config' => array( + 'phpbb_config' => array( 'bar_column' => array('UINT', 1), ), ), @@ -24,7 +24,7 @@ class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration { return array( 'drop_columns' => array( - '\phpbb\config\config' => array( + 'phpbb_config' => array( 'bar_column', ), ), diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index d336854a1c..6679ae407b 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -35,7 +35,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->db = $this->new_dbal(); $this->db_tools = new \phpbb\db\tools($this->db); - $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, '\phpbb\config\config'); + $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, 'phpbb_config'); $tools = array( new \phpbb\db\migration\tool\config($this->config), @@ -91,7 +91,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", 'Dummy migration created extra_column with value 1 in all rows.' ); @@ -107,7 +107,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case ); // cleanup - $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); + $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); } public function test_unfulfillable() @@ -123,11 +123,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", 'Dummy migration was run, even though an unfulfillable migration was found.' ); - $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); + $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); } public function test_if() @@ -192,7 +192,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('bar_column' => '1')), - "SELECT bar_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'", 'Installing revert migration failed to create bar_column.' ); @@ -208,7 +208,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertFalse(isset($this->config['foobartest'])); - $sql = 'SELECT * FROM \phpbb\config\config'; + $sql = 'SELECT * FROM phpbb_config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); @@ -237,7 +237,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case // Failure should have caused an automatic roll-back, so this should not exist. $this->assertFalse(isset($this->config['foobar3'])); - $sql = 'SELECT * FROM \phpbb\config\config'; + $sql = 'SELECT * FROM phpbb_config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); diff --git a/tests/dbal/schema_test.php b/tests/dbal/schema_test.php index a09daa0f76..2a332fddba 100644 --- a/tests/dbal/schema_test.php +++ b/tests/dbal/schema_test.php @@ -21,13 +21,13 @@ class phpbb_dbal_schema_test extends phpbb_database_test_case $db = $this->new_dbal(); $value = str_repeat("\xC3\x84", 255); - $sql = "INSERT INTO \phpbb\config\config + $sql = "INSERT INTO phpbb_config (config_name, config_value) VALUES ('name', '$value')"; $result = $db->sql_query($sql); $sql = "SELECT config_value - FROM \phpbb\config\config + FROM phpbb_config WHERE config_name = 'name'"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php index 976495d195..a70eea4f7e 100644 --- a/tests/dbal/sql_insert_buffer_test.php +++ b/tests/dbal/sql_insert_buffer_test.php @@ -17,7 +17,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->buffer = new \phpbb\db\sql_insert_buffer($this->db, '\phpbb\config\config', 2); + $this->buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_config', 2); $this->assert_config_count(2); } @@ -81,7 +81,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case protected function assert_config_count($num_configs) { $sql = 'SELECT COUNT(*) AS num_configs - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $this->db->sql_query($sql); $this->assertEquals($num_configs, $this->db->sql_fetchfield('num_configs')); $this->db->sql_freeresult($result); diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php index c0f0c271d2..c069d9a796 100644 --- a/tests/dbal/write_test.php +++ b/tests/dbal/write_test.php @@ -39,11 +39,11 @@ class phpbb_dbal_write_test extends phpbb_database_test_case { $db = $this->new_dbal(); - $sql = 'INSERT INTO \phpbb\config\config ' . $db->sql_build_array('INSERT', $sql_ary); + $sql = 'INSERT INTO phpbb_config ' . $db->sql_build_array('INSERT', $sql_ary); $result = $db->sql_query($sql); $sql = "SELECT * - FROM \phpbb\config\config + FROM phpbb_config WHERE config_name = '" . $sql_ary['config_name'] . "'"; $result = $db->sql_query_limit($sql, 1); @@ -56,15 +56,15 @@ class phpbb_dbal_write_test extends phpbb_database_test_case { $db = $this->new_dbal(); - $sql = "DELETE FROM \phpbb\config\config + $sql = "DELETE FROM phpbb_config WHERE config_name = 'config1'"; $result = $db->sql_query($sql); $sql = 'SELECT * - FROM \phpbb\config\config'; + FROM phpbb_config'; $result = $db->sql_query($sql); $rows = $db->sql_fetchrowset($result); - + $this->assertEquals(1, sizeof($rows)); $this->assertEquals('config2', $rows[0]['config_name']); @@ -76,7 +76,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case $db = $this->new_dbal(); // empty the table - $sql = 'DELETE FROM \phpbb\config\config'; + $sql = 'DELETE FROM phpbb_config'; $db->sql_query($sql); $batch_ary = array( @@ -92,10 +92,10 @@ class phpbb_dbal_write_test extends phpbb_database_test_case ), ); - $result = $db->sql_multi_insert('\phpbb\config\config', $batch_ary); + $result = $db->sql_multi_insert('phpbb_config', $batch_ary); $sql = 'SELECT * - FROM \phpbb\config\config + FROM phpbb_config ORDER BY config_name ASC'; $result = $db->sql_query($sql); @@ -155,12 +155,12 @@ class phpbb_dbal_write_test extends phpbb_database_test_case { $db = $this->new_dbal(); - $sql = 'UPDATE \phpbb\config\config + $sql = 'UPDATE phpbb_config SET ' . $db->sql_build_array('UPDATE', $sql_ary) . $where; $result = $db->sql_query($sql); $sql = 'SELECT * - FROM \phpbb\config\config + FROM phpbb_config ORDER BY config_name ASC'; $result = $db->sql_query($sql);