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/console/cron/cron_list_test.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'tests/console/cron/cron_list_test.php') diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index fdc9a05cb2..99291ec215 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -74,7 +74,34 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case $task->set_name('command' . $i); $i++; } - $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $pathEx); + + $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, + $pathEx + ); + + $this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $pathEx); } public function get_command_tester() -- 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/console/cron/cron_list_test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/console/cron/cron_list_test.php') diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index 99291ec215..d56d5b040f 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -90,6 +90,7 @@ class phpbb_console_command_cron_list_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 42b7782927713c2ca2fb704db6217016347b586e Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 19 Mar 2017 21:46:20 +0700 Subject: [ticket/14972] Migrate from deprecated getMock() method to createMock() PHPBB3-14972 --- tests/console/cron/cron_list_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/console/cron/cron_list_test.php') diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index d56d5b040f..bfc897ac2e 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -34,7 +34,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case { global $phpbb_root_path, $phpEx; - $this->user = $this->getMock('\phpbb\user', array(), array( + $this->user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); -- 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/console/cron/cron_list_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/console/cron/cron_list_test.php') diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index bfc897ac2e..8c7424c50d 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -30,7 +30,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case protected $command_tester; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; -- cgit v1.2.1