diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-13 21:12:50 -0600 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-13 21:41:52 -0600 |
commit | 193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4 (patch) | |
tree | 4903a30888d4a33a6b38dbfa818d8aa0a8647333 /tests/extension/manager_test.php | |
parent | 3a68bba2fbfe8416884ac5230876cc73c3ba30bd (diff) | |
download | forums-193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4.tar forums-193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4.tar.gz forums-193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4.tar.bz2 forums-193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4.tar.xz forums-193a3beb8f75e17b09a0e66d2815bc2bf8d4dce4.zip |
[feature/migrations] Fix failing tests (again)
PHPBB3-11318
Diffstat (limited to 'tests/extension/manager_test.php')
-rw-r--r-- | tests/extension/manager_test.php | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index e31e27ef83..9032afbd73 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -25,23 +25,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case { parent::setUp(); - $config = new phpbb_config(array()); - $db = $this->new_dbal(); - $db_tools = new phpbb_db_tools($db); - $phpbb_root_path = __DIR__ . './../../phpBB/'; - $php_ext = 'php'; - $table_prefix = 'phpbb_'; - - $this->extension_manager = new phpbb_extension_manager( - new phpbb_mock_container_builder(), - $db, - $config, - new phpbb_db_migrator($config, $db, $db_tools, 'phpbb_migrations', $phpbb_root_path, $php_ext, $table_prefix, array()), - 'phpbb_ext', - dirname(__FILE__) . '/', - '.' . $php_ext, - new phpbb_mock_cache() - ); + $this->extension_manager = $this->create_extension_manager(); } public function test_available() @@ -98,16 +82,30 @@ class phpbb_extension_manager_test extends phpbb_database_test_case public function test_enabled_no_cache() { - $extension_manager = new phpbb_extension_manager( + $extension_manager = $this->create_extension_manager(false); + + $this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled())); + } + + protected function create_extension_manager($with_cache = true) + { + + $config = new phpbb_config(array()); + $db = $this->new_dbal(); + $db_tools = new phpbb_db_tools($db); + $phpbb_root_path = __DIR__ . './../../phpBB/'; + $php_ext = 'php'; + $table_prefix = 'phpbb_'; + + return new phpbb_extension_manager( new phpbb_mock_container_builder(), - $this->new_dbal(), - new phpbb_config(array()), + $db, + $config, + new phpbb_db_migrator($config, $db, $db_tools, 'phpbb_migrations', $phpbb_root_path, $php_ext, $table_prefix, array()), 'phpbb_ext', dirname(__FILE__) . '/', - '.php' + '.' . $php_ext, + ($with_cache) ? new phpbb_mock_cache() : null ); - - $this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled())); } - } |