/** * {@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); } }
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'])); }
/** * @iterations 5000 */ public function assemble() { $this->assemblyRouter->assemble('route100/edit', ['id' => 100]); }