phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 241 forks source link

Fix methods signatures issue with sebastian/comparator:^1.1 #451

Closed drupol closed 1 year ago

drupol commented 4 years ago

Hi,

There is an issue in sebastian/comparator version 1.1.0 until version 1.2.2.

PHP Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /home/pol/dev/git/psrcas/vendor/sebastian/comparator/src/DOMNodeComparator.php on line 149

The issue comes from version 1.1.0 of sebastian/comparator.

See those two files:

Their signature is different and when installing using composer flag --prefer-lowest, it fails.

That issue has been fixed in version 1.2.3 (see commit)

Therefore I propose to raise the minimal version to 1.2.3 instead of 1.1.0.

Link to PR: #452

drupol commented 4 years ago

There is another issue.

If we do this, then when downgrading to sebastian/comparator:1.2.3, this package has also an issue with the signature in ClosureComparator.php.

I'll push a commit to fix this so we can clearly see the tests failing on first commit and tests succeeding on second one.