/** * @test */ public function processStringFromMetaDataWithOverwrite() { $this->markTestSkipped('Single Run of test passes whereas two tests in row semm to have a side effect on the cObj creation / usage'); $titleFormat = array('_typoScriptNodeValue' => 'TEXT', 'dataWrap' => '{field:fileName} by {field:artist}'); $itemMeta = new Tx_Yag_Domain_Model_ItemMeta(); $itemMeta->setCaptureDate(new DateTime('2012-10-08')); $itemMeta->setArtist('Daniel Lienert'); $item = new Tx_Yag_Domain_Model_Item(); $item->setOriginalFilename('test.jpg'); $item->setFilename('test.jpg'); $item->setItemMeta($itemMeta); $overWriteVars = array('artist' => 'Daniel'); $formattedString = $this->fixture->_call('processStringFromMetaData', $item, $titleFormat, $overWriteVars); $this->assertEquals('Test by Daniel', $formattedString); }
/** * Setter for itemMeta * * @param Tx_Yag_Domain_Model_ItemMeta $itemMeta Holds meta data for item * @return void */ public function setItemMeta(Tx_Yag_Domain_Model_ItemMeta $itemMeta) { $this->itemMeta = $itemMeta; if ($itemMeta->getCaptureDate() instanceof \DateTime) { $this->setDate($itemMeta->getCaptureDate()); } }
/** * @param $fileName * @param Tx_Yag_Domain_Model_ItemMeta $itemMeta */ protected function processXMPData($fileName, Tx_Yag_Domain_Model_ItemMeta $itemMeta) { $xmpData = $this->xmpParser->parseXmpData($fileName); $itemMeta->setXmp($xmpData); $itemMeta->setArtistMail($this->xmpParser->getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork')); $itemMeta->setArtistWebsite($this->xmpParser->getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiUrlWork')); $itemMeta->setLens($this->xmpParser->getXmpValueByKey($xmpData, 'aux\\:Lens')); }