Example #1
0
 /**
  * Test instantiation of cookie object class
  */
 public function testHttpCookieInstantiationOfCookieObject()
 {
     $hash = md5(time());
     $dateTimeNow = new \DateTime();
     // init parser
     $cookie = new HttpCookie('testCookieName001', $hash, $dateTimeNow, null, 'testdomain.local', '/', false, true);
     // assert stuff
     $this->assertSame($cookie->getName(), 'testCookieName001');
     $this->assertSame($cookie->getValue(), $hash);
     $this->assertSame($cookie->getExpires(), $dateTimeNow->getTimestamp());
     $this->assertSame($cookie->getMaximumAge(), null);
     $this->assertSame($cookie->getDomain(), 'testdomain.local');
     $this->assertSame($cookie->getPath(), '/');
     $this->assertSame($cookie->isSecure(), false);
     $this->assertSame($cookie->isHttpOnly(), true);
 }