Esempio n. 1
0
 public function __destruct()
 {
     $this->container->add($this->route);
 }
Esempio n. 2
0
 public function testSameDynamicPathsWithDifferentMethodIsMatched()
 {
     $routeA = new Route('GET', new RouteData('path/{a}', ['a' => '([^/]+)']));
     $routeB = new Route('PUT', new RouteData('path/{a}', ['a' => '([^/]+)']));
     $routes = new RouteContainer();
     $routes->add($routeA);
     $routes->add($routeB);
     $matcher = new RouteMatcher($routes, new Configuration());
     $match = $matcher->match(new Request(Request::METHOD_GET, 'path/a'));
     $this->assertSame($routeA, $match->getRoute());
     $match = $matcher->match(new Request(Request::METHOD_PUT, 'path/a'));
     $this->assertSame($routeB, $match->getRoute());
 }