mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
4eaa356679
7 changed files with 116 additions and 22 deletions
|
@ -2,7 +2,7 @@ services:
|
||||||
cron.manager:
|
cron.manager:
|
||||||
class: phpbb\cron\manager
|
class: phpbb\cron\manager
|
||||||
arguments:
|
arguments:
|
||||||
- '@cron.task_collection'
|
- '@service_container'
|
||||||
- '@routing.helper'
|
- '@routing.helper'
|
||||||
- '%core.root_path%'
|
- '%core.root_path%'
|
||||||
- '%core.php_ext%'
|
- '%core.php_ext%'
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace phpbb\cron;
|
||||||
|
|
||||||
use phpbb\cron\task\wrapper;
|
use phpbb\cron\task\wrapper;
|
||||||
use phpbb\routing\helper;
|
use phpbb\routing\helper;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cron manager class.
|
* Cron manager class.
|
||||||
|
@ -23,6 +24,11 @@ use phpbb\routing\helper;
|
||||||
*/
|
*/
|
||||||
class manager
|
class manager
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var ContainerInterface
|
||||||
|
*/
|
||||||
|
protected $phpbb_container;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var helper
|
* @var helper
|
||||||
*/
|
*/
|
||||||
|
@ -34,7 +40,14 @@ class manager
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $tasks = array();
|
protected $tasks = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag indicating if $this->tasks contains tasks registered in the container
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $is_initialised_from_container = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -49,18 +62,17 @@ class manager
|
||||||
/**
|
/**
|
||||||
* Constructor. Loads all available tasks.
|
* Constructor. Loads all available tasks.
|
||||||
*
|
*
|
||||||
* @param array|\Traversable $tasks Provides an iterable set of task names
|
* @param ContainerInterface $phpbb_container Container
|
||||||
* @param helper $routing_helper Routing helper
|
* @param helper $routing_helper Routing helper
|
||||||
* @param string $phpbb_root_path Relative path to phpBB root
|
* @param string $phpbb_root_path Relative path to phpBB root
|
||||||
* @param string $php_ext PHP file extension
|
* @param string $php_ext PHP file extension
|
||||||
*/
|
*/
|
||||||
public function __construct($tasks, helper $routing_helper, $phpbb_root_path, $php_ext)
|
public function __construct(ContainerInterface $phpbb_container, helper $routing_helper, $phpbb_root_path, $php_ext)
|
||||||
{
|
{
|
||||||
|
$this->phpbb_container = $phpbb_container;
|
||||||
$this->routing_helper = $routing_helper;
|
$this->routing_helper = $routing_helper;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
|
||||||
$this->load_tasks($tasks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,6 +91,24 @@ class manager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads registered tasks from the container, wraps them
|
||||||
|
* and puts them into $this->tasks.
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function load_tasks_from_container()
|
||||||
|
{
|
||||||
|
if (!$this->is_initialised_from_container)
|
||||||
|
{
|
||||||
|
$this->is_initialised_from_container = true;
|
||||||
|
|
||||||
|
$tasks = $this->phpbb_container->get('cron.task_collection');
|
||||||
|
|
||||||
|
$this->load_tasks($tasks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a task that is ready to run.
|
* Finds a task that is ready to run.
|
||||||
*
|
*
|
||||||
|
@ -90,6 +120,8 @@ class manager
|
||||||
*/
|
*/
|
||||||
public function find_one_ready_task()
|
public function find_one_ready_task()
|
||||||
{
|
{
|
||||||
|
$this->load_tasks_from_container();
|
||||||
|
|
||||||
shuffle($this->tasks);
|
shuffle($this->tasks);
|
||||||
foreach ($this->tasks as $task)
|
foreach ($this->tasks as $task)
|
||||||
{
|
{
|
||||||
|
@ -108,7 +140,9 @@ class manager
|
||||||
*/
|
*/
|
||||||
public function find_all_ready_tasks()
|
public function find_all_ready_tasks()
|
||||||
{
|
{
|
||||||
$tasks = array();
|
$this->load_tasks_from_container();
|
||||||
|
|
||||||
|
$tasks = [];
|
||||||
foreach ($this->tasks as $task)
|
foreach ($this->tasks as $task)
|
||||||
{
|
{
|
||||||
if ($task->is_ready())
|
if ($task->is_ready())
|
||||||
|
@ -131,6 +165,8 @@ class manager
|
||||||
*/
|
*/
|
||||||
public function find_task($name)
|
public function find_task($name)
|
||||||
{
|
{
|
||||||
|
$this->load_tasks_from_container();
|
||||||
|
|
||||||
foreach ($this->tasks as $task)
|
foreach ($this->tasks as $task)
|
||||||
{
|
{
|
||||||
if ($task->get_name() == $name)
|
if ($task->get_name() == $name)
|
||||||
|
@ -148,6 +184,8 @@ class manager
|
||||||
*/
|
*/
|
||||||
public function get_tasks()
|
public function get_tasks()
|
||||||
{
|
{
|
||||||
|
$this->load_tasks_from_container();
|
||||||
|
|
||||||
return $this->tasks;
|
return $this->tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,11 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
|
||||||
$pathEx
|
$pathEx
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $pathEx);
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
|
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $pathEx);
|
||||||
|
$this->cron_manager->load_tasks($tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_command_tester()
|
public function get_command_tester()
|
||||||
|
|
|
@ -74,7 +74,11 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$phpEx
|
$phpEx
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx);
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
|
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx);
|
||||||
|
$this->cron_manager->load_tasks($tasks);
|
||||||
|
|
||||||
$this->assertSame('0', $config['cron_lock']);
|
$this->assertSame('0', $config['cron_lock']);
|
||||||
}
|
}
|
||||||
|
@ -149,7 +153,12 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$phpEx
|
$phpEx
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx);
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
|
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx);
|
||||||
|
$this->cron_manager->load_tasks($tasks);
|
||||||
|
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name));
|
$exit_status = $command_tester->execute(array('command' => $this->command_name));
|
||||||
|
|
||||||
|
@ -191,7 +200,12 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case
|
||||||
$phpEx
|
$phpEx
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->cron_manager = new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx);
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
|
$this->cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx);
|
||||||
|
$this->cron_manager->load_tasks($tasks);
|
||||||
|
|
||||||
$command_tester = $this->get_command_tester();
|
$command_tester = $this->get_command_tester();
|
||||||
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
$exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true));
|
||||||
|
|
||||||
|
|
|
@ -202,13 +202,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -262,13 +265,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -322,13 +328,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_absolute($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_absolute($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -382,13 +391,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_relative_path($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_relative_path($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -442,13 +454,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_network($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_network($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -502,13 +517,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_absolute_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_absolute_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -559,13 +577,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_relative_path_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_relative_path_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -619,13 +640,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
*/
|
*/
|
||||||
public function test_helper_url_network_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
public function test_helper_url_network_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
{
|
{
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->config = new \phpbb\config\config(['enable_mod_rewrite' => '1']);
|
$this->config = new \phpbb\config\config(['enable_mod_rewrite' => '1']);
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
@ -668,12 +692,16 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
|
||||||
'server_protocol' => $server_protocol,
|
'server_protocol' => $server_protocol,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->root_path, 'php');
|
||||||
|
|
||||||
$this->helper = new phpbb_mock_controller_helper(
|
$this->helper = new phpbb_mock_controller_helper(
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, $this->root_path, 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, $this->root_path, 'php'),
|
||||||
$this->db,
|
$this->db,
|
||||||
$this->dispatcher,
|
$this->dispatcher,
|
||||||
$this->language,
|
$this->language,
|
||||||
|
|
|
@ -104,6 +104,12 @@ class phpbb_cron_manager_test extends \phpbb_test_case
|
||||||
$phpEx
|
$phpEx
|
||||||
);
|
);
|
||||||
|
|
||||||
return new \phpbb\cron\manager($tasks, $routing_helper, $phpbb_root_path, $phpEx);
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
|
$cron_manager = new \phpbb\cron\manager($mock_container, $routing_helper, $phpbb_root_path, $phpEx);
|
||||||
|
$cron_manager->load_tasks($tasks);
|
||||||
|
|
||||||
|
return $cron_manager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,10 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
new \phpbb\routing\file_locator(dirname(__FILE__) . '/')
|
new \phpbb\routing\file_locator(dirname(__FILE__) . '/')
|
||||||
);
|
);
|
||||||
$resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $manager);
|
$resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $manager);
|
||||||
|
|
||||||
|
$mock_container = new phpbb_mock_container_builder();
|
||||||
|
$mock_container->set('cron.task_collection', []);
|
||||||
|
|
||||||
$router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, 'php', dirname(__FILE__) . '/', true, true);
|
$router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, 'php', dirname(__FILE__) . '/', true, true);
|
||||||
|
|
||||||
$request = new phpbb_mock_request();
|
$request = new phpbb_mock_request();
|
||||||
|
@ -62,7 +66,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
|
||||||
new \phpbb\auth\auth(),
|
new \phpbb\auth\auth(),
|
||||||
new \phpbb\cache\driver\dummy(),
|
new \phpbb\cache\driver\dummy(),
|
||||||
$this->config,
|
$this->config,
|
||||||
new \phpbb\cron\manager([], $this->routing_helper, '', 'php'),
|
new \phpbb\cron\manager($mock_container, $this->routing_helper, '', 'php'),
|
||||||
$db,
|
$db,
|
||||||
new phpbb_mock_event_dispatcher(),
|
new phpbb_mock_event_dispatcher(),
|
||||||
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
|
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue