示例#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
 /**
  * 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());
 }