From 7a173877b7244f4ab6a8ff7b6fa0d6450027751b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Bartus?= Date: Fri, 18 Mar 2016 22:57:02 +0100 Subject: [ticket/14542] Move cron to controller PHPBB3-14542 --- tests/cron/manager_test.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'tests/cron/manager_test.php') diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 76f8c753bf..d204eb90d1 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -75,6 +75,32 @@ 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(); + + $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); } } -- cgit v1.2.1 From 271ac6b57e6725fb1aba869c832beb482f85d61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Bartus?= Date: Fri, 5 Aug 2016 23:03:35 +0200 Subject: [ticket/14542] Fix tests PHPBB3-14542 --- tests/cron/manager_test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/cron/manager_test.php') diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index d204eb90d1..610f662b7d 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -90,6 +90,7 @@ class phpbb_cron_manager_test extends \phpbb_test_case ->willReturn('foobar'); $request = new \phpbb\request\request(); + $request->enable_super_globals(); $routing_helper = new \phpbb\routing\helper( $mock_config, -- cgit v1.2.1 From ebac54aa9e705e99a562d2fe2c0f57bc6af8dd32 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Dec 2018 11:36:08 +0100 Subject: [ticket/14948] Adjust calls for twig and phpunit updates PHPBB3-14948 --- tests/cron/manager_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/cron/manager_test.php') diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 610f662b7d..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(), -- cgit v1.2.1