/** * {@inheritdoc} */ public function save(File $file, Adapter $adapter) { $datetime = $file->getLastModification(); if (null !== $datetime) { $adapter->writeLastModification($file->getName(), $datetime->format('U')); } return $this; }
function let(KnowsLastModification $adapter, Adapter $other, File $file) { $date = new \DateTime('2015-01-01', new \DateTimeZone("Europe/Paris")); $adapter->implement('Gaufrette\\Core\\Adapter'); $adapter->readLastModification('file.png')->willReturn(1234566000); $file->getName()->willReturn('file.png'); $file->getLastModification()->willReturn($date); }