comparator
comparator copied to clipboard
DOMNodeComparator swallows comments
In DOMNodeComparator::nodeToText we call $node->C14n(); without any parameters.
That results in all Comment (<!-- ... -->) nodes to be stripped.
I'd consider that a bug.
Given we still have #87, and maybe #71, we should probably have a look into how this comparator works :)
Additionally, the DOMNodeComparator::nodeToText has a bool parameter $canonicalize suggesting it could be optional. But the only caller, DOMNodeComparator::assertEquals, hardcodes it to true in both cases.
I guess we really need to refactor this one :)
Maybe we can use some of PR #88 while doing so.
@theseer https://github.com/sebastianbergmann/comparator/pull/97