diff options
Diffstat (limited to 'tests/dbal')
-rw-r--r-- | tests/dbal/auto_increment_test.php | 2 | ||||
-rw-r--r-- | tests/dbal/db_tools_test.php | 6 | ||||
-rw-r--r-- | tests/dbal/migration/dummy.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/fail.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/if.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/installed.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/recall.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/revert.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/revert_with_dependency.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/unfulfillable.php | 2 | ||||
-rw-r--r-- | tests/dbal/migrator_test.php | 20 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_config_test.php | 4 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_module_test.php | 10 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_permission_test.php | 6 | ||||
-rw-r--r-- | tests/dbal/sql_insert_buffer_test.php | 2 | ||||
-rw-r--r-- | tests/dbal/write_test.php | 2 |
16 files changed, 37 insertions, 31 deletions
diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php index 077bfad933..2196292e83 100644 --- a/tests/dbal/auto_increment_test.php +++ b/tests/dbal/auto_increment_test.php @@ -26,7 +26,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->tools = new phpbb_db_tools($this->db); + $this->tools = new \phpbb\db\tools($this->db); $this->table_data = array( 'COLUMNS' => array( diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 7bdbc696e7..e25335165a 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -26,7 +26,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->tools = new phpbb_db_tools($this->db); + $this->tools = new \phpbb\db\tools($this->db); $this->table_data = array( 'COLUMNS' => array( @@ -254,7 +254,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_peform_schema_changes_drop_tables() { - $db_tools = $this->getMock('phpbb_db_tools', array( + $db_tools = $this->getMock('\phpbb\db\tools', array( 'sql_table_exists', 'sql_table_drop', ), array(&$this->db)); @@ -280,7 +280,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_peform_schema_changes_drop_columns() { - $db_tools = $this->getMock('phpbb_db_tools', array( + $db_tools = $this->getMock('\phpbb\db\tools', array( 'sql_column_exists', 'sql_column_remove', ), array(&$this->db)); diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php index 0ac6e733a1..041c529855 100644 --- a/tests/dbal/migration/dummy.php +++ b/tests/dbal/migration/dummy.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_dummy extends phpbb_db_migration +class phpbb_dbal_migration_dummy extends \phpbb\db\migration\migration { static public function depends_on() { diff --git a/tests/dbal/migration/fail.php b/tests/dbal/migration/fail.php index f88d8169f5..d90972720d 100644 --- a/tests/dbal/migration/fail.php +++ b/tests/dbal/migration/fail.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_fail extends phpbb_db_migration +class phpbb_dbal_migration_fail extends \phpbb\db\migration\migration { function update_schema() { diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php index 83fe21bd21..bbbda60ea3 100644 --- a/tests/dbal/migration/if.php +++ b/tests/dbal/migration/if.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_if extends phpbb_db_migration +class phpbb_dbal_migration_if extends \phpbb\db\migration\migration { function update_schema() { diff --git a/tests/dbal/migration/installed.php b/tests/dbal/migration/installed.php index 01829f7a99..4b86896d9c 100644 --- a/tests/dbal/migration/installed.php +++ b/tests/dbal/migration/installed.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_installed extends phpbb_db_migration +class phpbb_dbal_migration_installed extends \phpbb\db\migration\migration { function effectively_installed() { diff --git a/tests/dbal/migration/recall.php b/tests/dbal/migration/recall.php index 6c2f04bf08..041d12ad27 100644 --- a/tests/dbal/migration/recall.php +++ b/tests/dbal/migration/recall.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_recall extends phpbb_db_migration +class phpbb_dbal_migration_recall extends \phpbb\db\migration\migration { function update_schema() { diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php index ac01987cd4..1882b20492 100644 --- a/tests/dbal/migration/revert.php +++ b/tests/dbal/migration/revert.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_revert extends phpbb_db_migration +class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration { function update_schema() { diff --git a/tests/dbal/migration/revert_with_dependency.php b/tests/dbal/migration/revert_with_dependency.php index ca2c070e8c..0b09fb784d 100644 --- a/tests/dbal/migration/revert_with_dependency.php +++ b/tests/dbal/migration/revert_with_dependency.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_revert_with_dependency extends phpbb_db_migration +class phpbb_dbal_migration_revert_with_dependency extends \phpbb\db\migration\migration { static public function depends_on() { diff --git a/tests/dbal/migration/unfulfillable.php b/tests/dbal/migration/unfulfillable.php index 6d375e6880..a1cdef9a23 100644 --- a/tests/dbal/migration/unfulfillable.php +++ b/tests/dbal/migration/unfulfillable.php @@ -7,7 +7,7 @@ * */ -class phpbb_dbal_migration_unfulfillable extends phpbb_db_migration +class phpbb_dbal_migration_unfulfillable extends \phpbb\db\migration\migration { static public function depends_on() { diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 9e55e4dd35..ef5d167fc2 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -33,15 +33,15 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->db_tools = new phpbb_db_tools($this->db); + $this->db_tools = new \phpbb\db\tools($this->db); - $this->config = new phpbb_config_db($this->db, new phpbb_mock_cache, 'phpbb_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), + new \phpbb\db\migration\tool\config($this->config), ); - $this->migrator = new phpbb_db_migrator( + $this->migrator = new \phpbb\db\migrator( $this->config, $this->db, $this->db_tools, @@ -55,11 +55,17 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $container = new phpbb_mock_container_builder(); $container->set('migrator', $migrator); - $this->extension_manager = new phpbb_extension_manager( + $this->extension_manager = new \phpbb\extension\manager( $container, $this->db, $this->config, - new phpbb_filesystem(), + new phpbb\filesystem( + new phpbb\symfony_request( + new phpbb_mock_request() + ), + dirname(__FILE__) . '/../../phpBB/', + 'php' + ), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', 'php', @@ -232,7 +238,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->migrator->update(); } } - catch (phpbb_db_migration_exception $e) {} + catch (\phpbb\db\migration\exception $e) {} // Failure should have caused an automatic roll-back, so this should not exist. $this->assertFalse(isset($this->config['foobar3'])); diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php index b82d1ef48d..a8d8966839 100644 --- a/tests/dbal/migrator_tool_config_test.php +++ b/tests/dbal/migrator_tool_config_test.php @@ -11,9 +11,9 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case { public function setup() { - $this->config = new phpbb_config(array()); + $this->config = new \phpbb\config\config(array()); - $this->tool = new phpbb_db_migration_tool_config($this->config); + $this->tool = new \phpbb\db\migration\tool\config($this->config); parent::setup(); } diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index 828fb76c65..3c23891348 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -27,15 +27,15 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case $skip_add_log = true; $db = $this->db = $this->new_dbal(); - $this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx); - $user = $this->user = new phpbb_user(); + $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx); + $user = $this->user = new \phpbb\user(); $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $auth = $this->getMock('phpbb_auth'); - $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); + $auth = $this->getMock('\phpbb\auth\auth'); + $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); - $this->tool = new phpbb_db_migration_tool_module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules'); + $this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules'); } public function exists_data() diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php index 79d9db66da..1090b4726a 100644 --- a/tests/dbal/migrator_tool_permission_test.php +++ b/tests/dbal/migrator_tool_permission_test.php @@ -24,10 +24,10 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case parent::setup(); $db = $this->db = $this->new_dbal(); - $cache = $this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx); - $this->auth = new phpbb_auth(); + $cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx); + $this->auth = new \phpbb\auth\auth(); - $this->tool = new phpbb_db_migration_tool_permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx); + $this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx); } public function exists_data() diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php index 45339a6b50..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', 2); + $this->buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_config', 2); $this->assert_config_count(2); } diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php index 987161a831..c069d9a796 100644 --- a/tests/dbal/write_test.php +++ b/tests/dbal/write_test.php @@ -64,7 +64,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case 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']); |