setExpires() public method

Sets the Expires HTTP header with a DateTime instance
public setExpires ( DateTime | string $date ) : void
$date DateTime | string A \DateTime instance or date as string
return void
Example #1
0
 /**
  * Test Expires
  */
 public function testExpiresAsDate()
 {
     $date = new \DateTime('2012-12-12T12:12:12+00:00');
     $this->cacheControl->setExpires($date);
     $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->cacheControl->getExpires());
     $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->response->getHeader('Expires'));
 }