public function ResponseTest::testSetExpires

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php, line 325

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