Merge pull request #561 from marc1706/ticket/560

[ticket/560] Properly instantiate router class in tests
This commit is contained in:
Marc Alexander
2015-06-03 19:33:28 +02:00

View File

@@ -36,7 +36,7 @@ class listener_test extends \phpbb_template_template_test_case
public function setup_listener() public function setup_listener()
{ {
global $cache, $db, $phpbb_root_path; global $cache, $db, $phpbb_root_path, $phpEx;
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions')); $cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions'));
$cache->expects($this->any()) $cache->expects($this->any())
@@ -73,8 +73,10 @@ class listener_test extends \phpbb_template_template_test_case
'board3_portal_enable' => '1', 'board3_portal_enable' => '1',
)); ));
$container = new \phpbb_mock_container_builder();
$filesystem = new \phpbb\filesystem\filesystem(); $filesystem = new \phpbb\filesystem\filesystem();
$router = new \phpbb_mock_router($filesystem, $manager, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT); $router = new \phpbb_mock_router($container, $filesystem, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT, $manager);
$router->find_routing_files($manager->all_enabled(false)); $router->find_routing_files($manager->all_enabled(false));
$router->find(dirname(__FILE__) . '/'); $router->find(dirname(__FILE__) . '/');
$this->controller_helper = new \phpbb_mock_controller_helper($this->template, $this->user, $this->config, $router, new \phpbb\symfony_request($request), $request, new \phpbb\filesystem(), '', 'php', dirname(__FILE__) . '/'); $this->controller_helper = new \phpbb_mock_controller_helper($this->template, $this->user, $this->config, $router, new \phpbb\symfony_request($request), $request, new \phpbb\filesystem(), '', 'php', dirname(__FILE__) . '/');