/** * @covers PHPExiftool\Driver\Metadata\MetadataBag::filterKeysByRegExp */ public function testFilterKeysByRegExp() { $this->object->set('oneKey', 'oneValue'); $this->object->set('oneSecondKey', 'anotherValue'); $this->object->set('thirdKey', 'thirdValue'); $this->assertEquals(2, count($this->object->filterKeysByRegExp('/one.*/'))); }
/** * Parse an Entity associated DOM, returns the metadatas * * @return MetadataBag */ public function ParseMetadatas() { $nodes = $this->getDomXpath()->query('/rdf:RDF/rdf:Description/*'); $metadatas = new MetadataBag(); foreach ($nodes as $node) { $tagname = $this->normalize($node->nodeName); try { $tag = TagFactory::getFromRDFTagname($tagname); } catch (TagUnknown $e) { continue; } $metaValue = $this->readNodeValue($node, $tag); $metadata = new Metadata($tag, $metaValue); $metadatas->set($tagname, $metadata); } return $metadatas; }