/** * @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); }
/** * @param $fileName * @param Tx_Yag_Domain_Model_ItemMeta $itemMeta */ protected function processIPTCData($fileName, Tx_Yag_Domain_Model_ItemMeta $itemMeta) { $iptcData = $this->iptcParser->parseIptcData($fileName); $itemMeta->setIptc(serialize($iptcData)); $itemMeta->setArtist($iptcData["2#080"][0]); $itemMeta->setCopyright($iptcData["2#116"][0]); $itemMeta->setTitle(trim($iptcData["2#005"][0])); if (is_array($iptcData['2#025'])) { $itemMeta->setKeywords(implode(',', $iptcData['2#025'])); } if (trim($iptcData["2#120"][0])) { $itemMeta->setDescription($iptcData["2#120"][0]); } }