mardi 2 février 2016

Codeception PhpBrowser grabAttributeFrom throws Exception DOMDocument::loadXML()

I updated my tests from Codeception 2.0.9 to 2.1.5.

Everything works fine except the PhpBrowser::grabAttributeFrom() method. I'll get a PHPUnit exception like this:

[PHPUnit_Framework_Exception] DOMDocument::loadXML(): Entity 'nbsp' not defined in Entity, line: 3

or

[PHPUnit_Framework_Exception] DOMDocument::loadXML(): Opening and ending tag mismatch: img line 141 and a in Entity, line: 142

It seems, that the grabAttributeFrom is very strict with HTML-DOM parsing. I googled the message and found, that the DOMDocument::loadHtml() is a bit less strict and would work.

http://ift.tt/1mam75I

How can I fix this grabAttributeFrom? I need the content of a href/src attribute of a HTML file.

Aucun commentaire:

Enregistrer un commentaire