Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function generateUri($name, array $substitutions = array())
 {
     $this->injectRoutes();
     try {
         return $this->router->assemble($name, $substitutions);
     } catch (OutOfBoundsException $e) {
         throw new RuntimeException(sprintf('Cannot generate URI based on route "%s"; route not found', $name), null, $e);
     }
 }
Ejemplo n.º 2
0
 public function testAssembleFragment()
 {
     $route = $this->prophesize(RouteInterface::class);
     $route->assemble([], null)->willReturn(new AssemblyResult());
     $router = new Router($this->buildRouteCollection(['foo' => $route->reveal()]), 'http://example.com/foo');
     $this->assertEquals('/foo#foo', $router->assemble('foo', [], ['fragment' => 'foo']));
 }
Ejemplo n.º 3
0
 /**
  * @iterations 5000
  */
 public function assemble()
 {
     $this->assemblyRouter->assemble('route100/edit', ['id' => 100]);
 }