コード例 #1
0
ファイル: ApplicationTest.php プロジェクト: rawebone/micro
 /**
  * @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
ファイル: MethodMatcher.php プロジェクト: rawebone/micro
 public function match(\Micro\Request $request, \Micro\ControllerInterface $controller)
 {
     return in_array($request->getMethod(), $controller->methods());
 }
コード例 #3
0
ファイル: Browser.php プロジェクト: rawebone/micro
 protected function makeRequest($uri, $method, array $headers, $content)
 {
     return Request::create($uri, strtoupper($method), array(), array(), array(), $headers, $content);
 }
コード例 #4
0
ファイル: UrlMatcher.php プロジェクト: rawebone/micro
 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());
 }