public function testConstructorAndDefaults() { $cookie = new Cookie('foo', 'bar'); $this->assertSame('foo', $cookie->getName()); $this->assertSame('bar', $cookie->getValue()); $this->assertSame(0, $cookie->getExpires()); $this->assertSame(null, $cookie->getPath()); $this->assertSame(null, $cookie->getDomain()); $this->assertFalse($cookie->isSecure()); $this->assertFalse($cookie->isHttpOnly()); }
/** * Returns a key=value representation of this Cookie, that can be used in a Cookie header. * * @return string */ public function toString() { return $this->cookie->getName() . '=' . rawurlencode($this->cookie->getValue()); }