rdohms/phpunit-arraysubset-asserts

I think that PHPUnit 8.5.2 introduced changes that broke phpunit-arraysubset-asserts

leob opened this issue · 1 comments

leob commented

Hi,

When my test (which uses Assert::assertArraySubset()) fails (does not pass), I get the following error:

TypeError: Argument 3 passed to PHPUnit\Framework\Constraint\Constraint::fail() must be an instance of PHPUnit\SebastianBergmann\Comparator\ComparisonFailure or null, instance of SebastianBergmann\Comparator\ComparisonFailure given, called in /Users/leo/sandbox/div/marvin/compigram/vendor/dms/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php on line 85

I'm able to fix this error by changing all occurrences of:

use SebastianBergmann\...

to:

use PHPUnit\SebastianBergmann\...

There are two (2) such "use" statements in Constraint\ArraySubset.php, and one (1) in ArraySubsetAsserts.

I'm running PHPUnit version 8.5.2, and my test code is as follows:

use DMS\PHPUnitExtensions\ArraySubset\Assert;

Assert::assertArraySubset([.........], $myArray);

I guess that it's PHPUnit 8.5.x which introduced a breaking change in these package names.

Fixed in v0.1.1 for PHPunit 8.4 and in v0.2.0 for PHPunit v9