예제 #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]));
 }
예제 #2
0
 public function createGroup($prefix = null, $suffix = null, $host = null, $scheme = null)
 {
     return $this->routes->addGroup($prefix, $suffix, $host, $scheme);
 }