mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge pull request #1801 from nickvergessen/ticket/11948
Ticket/11948 Extensions should be allowed to have more then 1 routing file
This commit is contained in:
@@ -34,10 +34,17 @@ class phpbb_controller_controller_test extends phpbb_test_case
|
||||
$provider = new \phpbb\controller\provider;
|
||||
$routes = $provider
|
||||
->import_paths_from_finder($this->extension_manager->get_finder())
|
||||
->find('./tests/controller/');
|
||||
->find(__DIR__);
|
||||
|
||||
// This will need to be updated if any new routes are defined
|
||||
$this->assertEquals(2, sizeof($routes));
|
||||
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('core_controller'));
|
||||
$this->assertEquals('/core_foo', $routes->get('core_controller')->getPath());
|
||||
|
||||
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller1'));
|
||||
$this->assertEquals('/foo', $routes->get('controller1')->getPath());
|
||||
|
||||
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('controller2'));
|
||||
$this->assertEquals('/foo/bar', $routes->get('controller2')->getPath());
|
||||
}
|
||||
|
||||
public function test_controller_resolver()
|
||||
|
@@ -1,3 +1,7 @@
|
||||
controller1:
|
||||
pattern: /foo
|
||||
defaults: { _controller: foo.controller:handle }
|
||||
|
||||
include_controller2:
|
||||
resource: "routing_2.yml"
|
||||
prefix: /foo
|
||||
|
3
tests/controller/ext/foo/config/routing_2.yml
Normal file
3
tests/controller/ext/foo/config/routing_2.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
controller2:
|
||||
pattern: /bar
|
||||
defaults: { _controller: foo.controller:handle }
|
Reference in New Issue
Block a user