diff options
Diffstat (limited to 'tests/cron')
-rw-r--r-- | tests/cron/manager_test.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 76f8c753bf..f025e38cd5 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php'; class phpbb_cron_manager_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { $this->manager = $this->create_cron_manager(array( new phpbb_cron_task_core_dummy_task(), @@ -75,6 +75,33 @@ class phpbb_cron_manager_test extends \phpbb_test_case { global $phpbb_root_path, $phpEx; - return new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx); + $mock_config = new \phpbb\config\config(array( + 'force_server_vars' => false, + 'enable_mod_rewrite' => '', + )); + + $mock_router = $this->getMockBuilder('\phpbb\routing\router') + ->setMethods(array('setContext', 'generate')) + ->disableOriginalConstructor() + ->getMock(); + $mock_router->method('setContext') + ->willReturn(true); + $mock_router->method('generate') + ->willReturn('foobar'); + + $request = new \phpbb\request\request(); + $request->enable_super_globals(); + + $routing_helper = new \phpbb\routing\helper( + $mock_config, + $mock_router, + new \phpbb\symfony_request($request), + $request, + new \phpbb\filesystem\filesystem(), + $phpbb_root_path, + $phpEx + ); + + return new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx); } } |