/** * @dataProvider sampleDataProvider */ public function testValueGetSet($defaults, $sample_data, $sample_data_other) { $response_cookie = new ResponseCookie($defaults['name'], $sample_data['value']); $this->assertSame($sample_data['value'], $response_cookie->getValue()); $this->assertInternalType('string', $response_cookie->getValue()); $response_cookie->setValue($sample_data_other['value']); $this->assertSame($sample_data_other['value'], $response_cookie->getValue()); $this->assertInternalType('string', $response_cookie->getValue()); }
/** * @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); }