public function testRedirectShouldAddLocationHeader() { $_SERVER['HTTP_HOST'] = 'localhost'; $_SERVER['SCRIPT_NAME'] = '/yoshi/index.php'; $_SERVER['REQUEST_URI'] = '/yoshi/login'; $_SERVER['REQUEST_METHOD'] = 'GET'; $response = new ResponseMock(); $response->sendRedirect('/login'); $this->assertContains('Location: /yoshi/login', $response->headers()); }
public function testResponseHeaders() { $response = new ResponseMock('text/html'); $expected = ['content-type' => ['name' => 'Content-type', 'value' => 'text/html']]; $this->assertEquals($expected, $response->getHeaders()); }