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