예제 #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());
 }