public function testParsing() { $config = [Route::HANDLER => 'A#b']; $this->route->addConfig($config); $route = $this->route->forVerb('GET'); $this->assertTrue($route instanceof RoutePart, 'Not RouterPart given'); $this->assertEquals('A', $route->controller(), 'Not the correct controller given'); $this->assertEquals('b', $route->action(), 'Not the correct action given'); }
/** * @param string $httpMethod * @param Route $route * @param string $effectiveUri * * @return RoutePart * @throws PathNotFoundException When it was not possible to find a matching route. */ private function getHandlerForUri($httpMethod, Route $route, $effectiveUri) { $handler = $route->forVerb($httpMethod); if ($handler == null) { throw new PathNotFoundException($httpMethod . ' - ' . $effectiveUri); } return $handler; }