/** * @dataProvider sampleDataProvider */ public function testNameGetSet($defaults, $sample_data, $sample_data_other) { $response_cookie = new ResponseCookie($sample_data['name']); $this->assertSame($sample_data['name'], $response_cookie->getName()); $this->assertInternalType('string', $response_cookie->getName()); $response_cookie->setName($sample_data_other['name']); $this->assertSame($sample_data_other['name'], $response_cookie->getName()); $this->assertInternalType('string', $response_cookie->getName()); }
/** * @param Cookie $cookie * * @return mixed */ public function addCookie(Cookie $cookie) { $cookie = new ResponseCookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiration(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); $this->response->cookies()->set($cookie->getName(), $cookie); }