phpunit-arraysubset-asserts icon indicating copy to clipboard operation
phpunit-arraysubset-asserts copied to clipboard

Support for PHPUnit 11

Open dmaicher opened this issue 1 year ago • 5 comments

Version 11 has been released so we should add compatibility.

Possibly its as easy as just allowing ^11.0 without any further changes? :thinking: I can take a look.

dmaicher avatar Feb 26 '24 07:02 dmaicher

Eh.. not really... been upgrading some other codebases and it's a pain (that is, if you want to fail the tests on deprecations as that means you have to fix all the PHPUnit deprecation notices and that's turned out to be a lot of work....).

I've also been wondering about the future of this package, now PHPUnit 11 has added some closely related assertions ? The PHPUnit Polyfills (v3) will support the new assertions all the way back to PHPUnit 6.x.

jrfnl avatar Feb 26 '24 08:02 jrfnl

Indeed there are some test fails with PHPUnit 11 :see_no_evil:

There was 1 error:

1) DMS\PHPUnitExtensions\ArraySubset\Tests\Unit\Constraint\ArraySubsetTest::testEvaluateFailMessage
Error: Call to undefined method DMS\PHPUnitExtensions\ArraySubset\Constraint\ArraySubset::exporter()

/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:110
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:125
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:100
/var/www/phpunit-arraysubset-asserts/tests/Unit/Constraint/ArraySubsetTest.php:88

--

There were 2 failures:

1) DMS\PHPUnitExtensions\ArraySubset\Tests\Unit\AssertTest::testAssertArraySubsetPassesStrictConfig
Failed asserting that exception of type "Error" matches expected exception "PHPUnit\Framework\ExpectationFailedException". Message was: "Call to undefined method DMS\PHPUnitExtensions\ArraySubset\Constraint\ArraySubset::exporter()" at
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:110
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:125
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:100
/var/www/phpunit-arraysubset-asserts/src/ArraySubsetAsserts.php:83
/var/www/phpunit-arraysubset-asserts/tests/Unit/AssertTest.php:26
.

2) DMS\PHPUnitExtensions\ArraySubset\Tests\Unit\AssertTest::testAssertArraySubsetThrowsExceptionForInvalidSubset
Failed asserting that exception of type "Error" matches expected exception "PHPUnit\Framework\ExpectationFailedException". Message was: "Call to undefined method DMS\PHPUnitExtensions\ArraySubset\Constraint\ArraySubset::exporter()" at
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:110
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:125
/var/www/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:100
/var/www/phpunit-arraysubset-asserts/src/ArraySubsetAsserts.php:83
/var/www/phpunit-arraysubset-asserts/tests/Unit/AssertTest.php:32

dmaicher avatar Mar 11 '24 15:03 dmaicher

@dmaicher If that's all, then there is most likely something wrong with the config.

jrfnl avatar Mar 11 '24 18:03 jrfnl

Any updates on this?

matthiasPOE avatar Jun 12 '24 11:06 matthiasPOE