Exemple #1
0
 protected function call($uri, $method, array $headers, $content = "")
 {
     $this->lastRequest = $this->lastResponse = null;
     $this->lastRequest = $this->makeRequest($uri, $method, $headers, $content);
     $this->application->run($this->lastRequest);
     $this->prepareResponse();
     return $this->lastResponse;
 }
Exemple #2
0
 public function testValidRequest()
 {
     $app = new Application();
     $app->attach(new ValidControllerFixture());
     $browser = new Browser($app);
     $resp = $browser->get("/");
     $this->assertEquals(200, $resp->getStatusCode());
 }
Exemple #3
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);
 }