You are here

public function ResponseTest::testSetExpires in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/ResponseTest.php \Symfony\Component\HttpFoundation\Tests\ResponseTest::testSetExpires()

File

vendor/symfony/http-foundation/Tests/ResponseTest.php, line 627

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testSetExpires() {
  $response = new Response();
  $response
    ->setExpires(null);
  $this
    ->assertNull($response
    ->getExpires(), '->setExpires() remove the header when passed null');
  $now = new \DateTime();
  $response
    ->setExpires($now);
  $this
    ->assertEquals($response
    ->getExpires()
    ->getTimestamp(), $now
    ->getTimestamp());
}