public function testSendCookies() { $headersSent = true; $headers = array(); $cookies = array(); UnitHeaderWrapper::setUp($headersSent, $headers, $cookies); $response = Response::make('', 302, array('Location' => 'foo.bar')); $response->setHeaderWrapper(new UnitHeaderWrapper()); $response->addCookie(Cookie::make('foo')); $response->sendCookies(); $this->assertCount(0, $cookies); $headersSent = false; $headers = array(); $cookies = array(); UnitHeaderWrapper::setUp($headersSent, $headers, $cookies); $response = Response::make('', 302, array('Location' => 'foo.bar')); $response->setHeaderWrapper(new UnitHeaderWrapper()); $response->addCookie(Cookie::make('foo')); $response->sendCookies(); $this->assertEquals('foo', $cookies[0]['name']); }
public function testWithCookie() { $response = RedirectResponse::make('http://foo.bar'); $response->withCookie(Cookie::make('foo')); $this->assertEquals(1, count($response->cookies)); }
public function testSetHttpOnly() { $cookie = Cookie::make('foo'); $cookie->setHttpOnly(false); $this->assertFalse($cookie->isHttpOnly()); }