diff options
Diffstat (limited to 'tests/groupposition/legend_test.php')
-rw-r--r-- | tests/groupposition/legend_test.php | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php index fe003e93a7..566a8a2935 100644 --- a/tests/groupposition/legend_test.php +++ b/tests/groupposition/legend_test.php @@ -33,11 +33,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_get_group_value($group_id, $expected, $throws_exception) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); if ($throws_exception) @@ -51,11 +53,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case public function test_get_group_count() { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); @@ -91,11 +95,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_add_group($group_id, $expected_added, $expected) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); @@ -179,11 +185,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_delete_group($group_id, $skip_group, $expected_deleted, $expected) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); @@ -234,11 +242,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_move_up($group_id, $excepted_moved, $expected) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); @@ -289,11 +299,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_move_down($group_id, $excepted_moved, $expected) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); @@ -387,11 +399,13 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case */ public function test_move($group_id, $increment, $excepted_moved, $expected) { - global $cache; + global $cache, $phpbb_root_path, $phpEx; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); - $user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->lang = array(); $test_class = new \phpbb\groupposition\legend($db, $user); |