/** * @expectedException \Micro\Exceptions\BadHandlerReturnException */ public function testNotFoundCalledOnBadRequest() { $notFound = $this->prophet->prophesize("Micro\\NotFoundControllerInterface"); $app = new Application(); $app->debugMode = true; $app->attach($notFound->reveal()); $req = Request::create("/"); $app->run($req); }
public function match(\Micro\Request $request, \Micro\ControllerInterface $controller) { return in_array($request->getMethod(), $controller->methods()); }
protected function makeRequest($uri, $method, array $headers, $content) { return Request::create($uri, strtoupper($method), array(), array(), array(), $headers, $content); }
public function match(\Micro\Request $request, \Micro\ControllerInterface $controller) { $ut = $this->ut; $regex = $ut->compile($controller->uri(), $controller->conditions()); return $ut->match($regex, $request->getPathInfo()); }