sebastianbergmann / comparator

Provides the functionality to compare PHP values for equality.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DOMNodeComparator fails if Node has no Document

thled opened this issue · comments

Some of my tests fail since this Commit: 8e77ef2#diff-0665d25cb8db14b20881e327fe1ca491

It seems like the declaration of strict types changed that the function nodeToText() cannot handle DOMNodes that have no DOMDocument.

Is this intended?

I mean I can fix it by creating DOMDocuments and then the DOMNodes in my failing tests but should this be necessary?

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

Thank you for the fast response!

I am having trouble to create a minimal, self-contained test case. Since my setup where the issue occures is a Symfony project with the Bridge Component to PHPUnit and I use Prophecy for mocking. It seems like Prophecy is part of the issue because if I use the PHPUnit mocking the issue does not occure.