コード例 #1
0
ファイル: CookieTest.php プロジェクト: brick/http
 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());
 }
コード例 #2
0
ファイル: ClientCookie.php プロジェクト: brick/http
 /**
  * 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());
 }