Beispiel #1
0
 protected function checkDynamicRoute(ServerRequestInterface $request, Route $route)
 {
     $resource = $route->getResource();
     if (preg_match('#' . $resource->getCompiledPath() . '#', $request->getUri()->getPath(), $params) == count($resource->getParams())) {
         array_shift($params);
         return $this->matches->getInstance($route, array_combine($resource->getParams(), $params));
     }
 }
Beispiel #2
0
 /**
  * @depends testConstructorSetsAttributes
  */
 public function testGetHandlerReturnsHandler()
 {
     $given = $expected = function () {
     };
     $instance = new Route(['GET'], $this->dummyResource, $given);
     $this->assertEquals($expected, $instance->getHandler());
 }