Пример #1
0
 /**
  * @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);
 }
Пример #2
0
 public function match(\Micro\Request $request, \Micro\ControllerInterface $controller)
 {
     return in_array($request->getMethod(), $controller->methods());
 }
Пример #3
0
 protected function makeRequest($uri, $method, array $headers, $content)
 {
     return Request::create($uri, strtoupper($method), array(), array(), array(), $headers, $content);
 }
Пример #4
0
 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());
 }