Ejemplo n.º 1
0
 /**
  * @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());
 }
Ejemplo n.º 2
0
 /**
  * @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);
 }