public getLastModified ( ) : DateTime | ||
Résultat | DateTime | The last modification date or NULL |
public function getLastModified()
{
return $this->headers->get('Last-Modified');
}
/** * @test */ public function setAndGetLastModifiedSetsTheLastModifiedHeader() { $date = \DateTime::createFromFormat(DATE_RFC2822, 'Tue, 22 May 2012 12:00:00 GMT'); $fig = \DateTime::createFromFormat(DATE_RFC2822, 'Tue, 21 May 2012 12:00:00 GMT'); $response = new Response(); $response->setNow($date); $this->assertNull($response->getLastModified()); $response->setLastModified($fig); $this->assertEquals($fig, $response->getLastModified()); }