/** * @param SplFileInfo $file * @return bool */ private function load(SplFileInfo $file) { try { $this->exifData = $this->exif->read($file->getRealPath()); $this->date = $this->exifData->getCreationDate(); } catch (\RuntimeException $e) { // do nothing } }
/** * @group reader * @covers \PHPExif\Reader\Reader::read */ public function testGetExifPassedToAdapter() { $adapter = $this->getMock('\\PHPExif\\Adapter\\AdapterInterface'); $adapter->expects($this->once())->method('getExifFromFile'); $reflProperty = new \ReflectionProperty('\\PHPExif\\Reader\\Reader', 'adapter'); $reflProperty->setAccessible(true); $reflProperty->setValue($this->reader, $adapter); $this->reader->read('/tmp/foo.bar'); }