/** * @test */ public function canGetContentDOM() { $content = '<?xml version="1.0" encoding="UTF-8"?><promotion> <title>test</title> <type>organic</type> <image>http://www.foobar.de/test.gif</image> <searchterms> <searchterm>one</searchterm> <searchterm>two</searchterm> </searchterms> <solrfieldvalues> <solrfieldvalue fieldname="test">Fooobar</solrfieldvalue> </solrfieldvalues> <content><![CDATA[ <html> <head></head> <body><![CDATA[test]]]]><![CDATA[></body> </html> ]]></content> </promotion>'; $this->promotion->__setProperty('content', $content); $this->assertInstanceOf('\\DOMDocument', $this->promotion->getContentDOM(), 'Could not dom object from content'); $xpath = new \DOMXPath($this->promotion->getContentDOM()); $typePath = $xpath->query("//type"); $this->assertEquals((string) $typePath->item(0)->textContent, "organic"); }