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; }
public function testValidRequest() { $app = new Application(); $app->attach(new ValidControllerFixture()); $browser = new Browser($app); $resp = $browser->get("/"); $this->assertEquals(200, $resp->getStatusCode()); }
/** * @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); }