1
0
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:
Nils Adermann
2013-10-22 00:29:20 -07:00
5 changed files with 30 additions and 17 deletions

View File

@@ -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()

View File

@@ -1,3 +1,7 @@
controller1:
pattern: /foo
defaults: { _controller: foo.controller:handle }
include_controller2:
resource: "routing_2.yml"
prefix: /foo

View File

@@ -0,0 +1,3 @@
controller2:
pattern: /bar
defaults: { _controller: foo.controller:handle }