/** * tests getting the generation date * * @group data * @group sourcetest */ public function testGetGenerationDate() { // Time isn't always exact, so allow a few seconds grace either way... $currentTime = time(); $minTime = $currentTime - 3; $maxTime = $currentTime + 3; $testDateTime = $this->object->getGenerationDate(); self::assertInstanceOf('\\DateTime', $testDateTime); $testTime = $testDateTime->getTimestamp(); self::assertGreaterThanOrEqual($minTime, $testTime); self::assertLessThanOrEqual($maxTime, $testTime); }
/** * renders the version information * * @param string $version * @param \Browscap\Data\DataCollection $collection * * @return \Browscap\Writer\WriterCollection */ public function renderVersion($version, DataCollection $collection) { foreach ($this->writers as $writer) { $writer->renderVersion(array('version' => $version, 'released' => $collection->getGenerationDate()->format('r'), 'format' => $writer->getFormatter()->getType(), 'type' => $writer->getFilter()->getType())); } return $this; }