public function testExceptionThrownWhenNoStatusCode() { $response = new Response(new \App\Config\AppConfig()); $this->setExpectedException('BadMethodCallException', 'HTTP Response is missing a status code'); $response->getStatusCode(); }
public function testRedirectSetsCode() { $response = new Response(new App()); try { $response->redirect('example.com', 'auto', 307); $this->fail('RedirectException should be raised.'); } catch (RedirectException $e) { } $this->assertTrue($response->hasHeader('location')); $this->assertEquals('example.com', $response->getHeaderLine('Location')); $this->assertEquals(307, $response->getStatusCode()); }