public function testSetAsCache() { $cc = new CacheControl(); $dt = new DateTimeObject(); $cc->setAsCache($dt->add('3 hours')); $ccHeaders = $cc->getCacheControl(); $maxAge = $dt->getTimestamp() - time(); $this->assertSame('private, max-age=' . $maxAge, $ccHeaders['Cache-Control']); $dtFormatted = date('D, d M Y H:i:s', $dt->getTimestamp()); $this->assertSame($dtFormatted . ' GMT', $ccHeaders['Expires']); }
public function testAdd2() { $dt = new DateTimeObject('14.02.2013'); $dt->add("P5D"); $this->assertSame('19.02.2013', $dt->format('d.m.Y')); }