You are here

public function CookieTest::testIsExpired in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/browser-kit/Tests/CookieTest.php \Symfony\Component\BrowserKit\Tests\CookieTest::testIsExpired()

File

vendor/symfony/browser-kit/Tests/CookieTest.php, line 168

Class

CookieTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testIsExpired() {
  $cookie = new Cookie('foo', 'bar');
  $this
    ->assertFalse($cookie
    ->isExpired(), '->isExpired() returns false when the cookie never expires (null as expires time)');
  $cookie = new Cookie('foo', 'bar', time() - 86400);
  $this
    ->assertTrue($cookie
    ->isExpired(), '->isExpired() returns true when the cookie is expired');
  $cookie = new Cookie('foo', 'bar', 0);
  $this
    ->assertFalse($cookie
    ->isExpired());
}