diff options
author | Máté Bartus <mate.bartus@gmail.com> | 2015-10-08 14:55:23 +0200 |
---|---|---|
committer | Máté Bartus <mate.bartus@gmail.com> | 2015-10-08 14:55:23 +0200 |
commit | ce2caf248cd0653b8a4304341415e9401abdf416 (patch) | |
tree | 18aeb27b2a7f78b780c8152f5a12430c956ed699 /tests/controller/controller_test.php | |
parent | a0ba6b7dc6411d5fd6aee9b17cb176905af0482a (diff) | |
parent | 403c647b9e84640977ca0f98d21d15ceb4957bdb (diff) | |
download | forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.gz forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.bz2 forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.xz forums-ce2caf248cd0653b8a4304341415e9401abdf416.zip |
Merge pull request #3948 from Nicofuma/ticket/14220
[ticket/14220] Move route loading to services
Diffstat (limited to 'tests/controller/controller_test.php')
-rw-r--r-- | tests/controller/controller_test.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index d0295d66bc..431b26b2bc 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -38,14 +38,17 @@ class phpbb_controller_controller_test extends phpbb_test_case )); } - public function test_router_find_files() + public function test_router_default_loader() { $container = new phpbb_mock_container_builder(); $container->setParameter('core.environment', PHPBB_ENVIRONMENT); - $router = new \phpbb\routing\router($container, new \phpbb\filesystem\filesystem(), dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT, $this->extension_manager); - $router->find_routing_files($this->extension_manager->all_enabled(false)); - $routes = $router->find(__DIR__)->get_routes(); + $loader = new \Symfony\Component\Routing\Loader\YamlFileLoader( + new \phpbb\routing\file_locator(new \phpbb\filesystem\filesystem(), dirname(__FILE__) . '/') + ); + $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager); + $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT); + $routes = $router->get_routes(); // This will need to be updated if any new routes are defined $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('core_controller')); |