Ejemplo n.º 1
0
 public function testNamedRoutes()
 {
     $routes = new RouteCollection(new HttpMessageStrategy());
     $routes->addRoute('GET', '/user/{id}', function () {
     })->setName('UserProfile');
     $builder = new UrlBuilder(ServerRequestFactory::fromGlobals($this->fakeServerParams()), $routes);
     $this->assertEquals('/site/user/23', $builder->createByName('UserProfile', ['id' => 23]));
 }
Ejemplo n.º 2
0
 public function createGroup($prefix = null, $suffix = null, $host = null, $scheme = null)
 {
     return $this->routes->addGroup($prefix, $suffix, $host, $scheme);
 }