public function last_modified() { $lastModified = new Date('2012-12-07 15:05:00', TimeZone::getByName('Europe/Berlin')); $n = new Node('record'); (new ContentRecord('http://localhost/'))->lastModified($lastModified)->visit($n); $this->assertEquals('Fri, 07 Dec 2012 15:05:00 +0100', $n->getAttribute('last-modified')); }
public function parse_canonical() { $this->assertEquals(['canonical' => new Date('2001-12-15 02:59:43', \util\TimeZone::getByName('GMT'))], $this->parse('canonical: 2001-12-15T02:59:43.1Z')); }
/** * Write response headers * * @param scriptlet.Response response * @param peer.URL base * @param string format */ protected function writeHead($response, $base, $format) { $response->setContentType($this->mediaType); if (null !== $this->contentLength) { $response->setContentLength($this->contentLength); } if (null !== $this->lastModified) { $response->setHeader('Last-Modified', \util\TimeZone::getByName('GMT')->translate($this->lastModified)->toString('D, d M Y H:i:s \\G\\M\\T')); } }