Example #1
0
 /**
  * @expectedException \IceHawk\IceHawk\Exceptions\UnresolvedRequest
  */
 public function testWriteRouterSkipsRoutesWithReadRequestHandler()
 {
     $matchingUri = '/test';
     $routes = [new ReadRoute(new Literal($matchingUri), new GetRequestHandler())];
     $routeRequest = new RouteRequest($matchingUri, 'POST');
     $writeRouter = new WriteRouter($routes);
     $writeRouter->findMatchingRoute($routeRequest);
 }
Example #2
0
 /**
  * @throws UnresolvedRequest
  */
 private function getHandlerRoute() : RoutesToWriteHandler
 {
     $routes = $this->config->getWriteRoutes();
     $requestInfo = $this->config->getRequestInfo();
     $routeRequest = new RouteRequest($requestInfo->getUri(), $requestInfo->getMethod());
     $router = new WriteRouter($routes);
     $handlerRoute = $router->findMatchingRoute($routeRequest);
     return $handlerRoute;
 }