setLastModified() public method

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