diff options
Diffstat (limited to 'tests/dbal')
-rw-r--r-- | tests/dbal/auto_increment_test.php | 3 | ||||
-rw-r--r-- | tests/dbal/connect_test.php | 4 | ||||
-rw-r--r-- | tests/dbal/db_tools_test.php | 9 | ||||
-rw-r--r-- | tests/dbal/migrator_test.php | 7 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_module_test.php | 8 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_permission_test.php | 2 |
6 files changed, 19 insertions, 14 deletions
diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php index 1ed8ea29e3..39eb6835ff 100644 --- a/tests/dbal/auto_increment_test.php +++ b/tests/dbal/auto_increment_test.php @@ -30,7 +30,8 @@ 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); + $factory = new \phpbb\db\tools\factory(); + $this->tools = $factory->get($this->db); $this->table_data = array( 'COLUMNS' => array( diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php index 1ae34bd2b6..edf57189cb 100644 --- a/tests/dbal/connect_test.php +++ b/tests/dbal/connect_test.php @@ -22,7 +22,9 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case public function test_failing_connect() { - global $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx, $phpbb_filesystem; + + $phpbb_filesystem = new phpbb\filesystem\filesystem(); $config = $this->get_database_config(); diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 5832b966d8..aa0b6ccf48 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -17,7 +17,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case { /** @var \phpbb\db\driver\driver_interface */ protected $db; - /** @var \phpbb\db\tools */ + /** @var \phpbb\db\tools\tools_interface */ protected $tools; protected $table_exists; protected $table_data; @@ -32,7 +32,8 @@ 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); + $factory = new \phpbb\db\tools\factory(); + $this->tools = $factory->get($this->db); $this->table_data = array( 'COLUMNS' => array( @@ -340,7 +341,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_perform_schema_changes_drop_tables() { - $db_tools = $this->getMock('\phpbb\db\tools', array( + $db_tools = $this->getMock('\phpbb\db\tools\tools', array( 'sql_table_exists', 'sql_table_drop', ), array(&$this->db)); @@ -366,7 +367,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case public function test_perform_schema_changes_drop_columns() { - $db_tools = $this->getMock('\phpbb\db\tools', array( + $db_tools = $this->getMock('\phpbb\db\tools\tools', array( 'sql_column_exists', 'sql_column_remove', ), array(&$this->db)); diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 4c4306888c..f52e6ea63d 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -38,7 +38,8 @@ 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); + $factory = new \phpbb\db\tools\factory(); + $this->db_tools = $factory->get($this->db); $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, 'phpbb_config'); @@ -62,14 +63,12 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case ); $container->set('migrator', $this->migrator); $container->set('dispatcher', new phpbb_mock_event_dispatcher()); - $user = new \phpbb\user('\phpbb\datetime'); $this->extension_manager = new \phpbb\extension\manager( $container, $this->db, $this->config, - new phpbb\filesystem(), - $user, + new phpbb\filesystem\filesystem(), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', 'php', diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index 08c3e979b8..695a7e7a7f 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -27,12 +27,14 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case parent::setup(); - // Force add_log function to not be used + // Disable the logs $skip_add_log = true; $db = $this->db = $this->new_dbal(); - $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('\phpbb\user'); + $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = $this->user = new \phpbb\user($lang, '\phpbb\datetime'); $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php index 4453fbf123..3d190e7a11 100644 --- a/tests/dbal/migrator_tool_permission_test.php +++ b/tests/dbal/migrator_tool_permission_test.php @@ -28,7 +28,7 @@ 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\config(array()), $this->db, $phpbb_root_path, $phpEx); + $cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), 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); |