Backwards phpunit compatibility
sandervanhooft opened this issue · 3 comments
sandervanhooft commented
For (app) projects, it's probably fine to upgrade to phpunit 8 and above.
But some php packages will require at least phpunit 7 compatibility though.
I've forked your project and tried downgrading to phpunit 7. Running tests results in these issues:
There was 1 error:
1) DMS\PHPUnitExtensions\ArraySubset\Tests\Unit\Constraint\ArraySubsetTest::testEvaluateFailMessage
Error: Call to undefined method DMS\PHPUnitExtensions\ArraySubset\Constraint\ArraySubset::exporter()
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:95
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:110
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:85
/Users/sander/apps/phpunit-arraysubset-asserts/tests/Unit/Constraint/ArraySubsetTest.php:83
--
There were 2 failures:
1) DMS\PHPUnitExtensions\ArraySubset\Tests\Unit\AssertTest::testAssertArraySubsetPassesStrictConfig
Failed asserting that exception of type "PHPUnit\Framework\Error\Warning" matches expected exception "PHPUnit\Framework\ExpectationFailedException". Message was: "Declaration of DMS\PHPUnitExtensions\ArraySubset\Constraint\ArraySubset::evaluate($other, string $description = '', bool $returnResult = false) should be compatible with PHPUnit\Framework\Constraint\Constraint::evaluate($other, $description = '', $returnResult = false)" at
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:24
/Users/sander/apps/phpunit-arraysubset-asserts/src/ArraySubsetAsserts.php:41
/Users/sander/apps/phpunit-arraysubset-asserts/tests/Unit/AssertTest.php:16
.
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
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:95
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:110
/Users/sander/apps/phpunit-arraysubset-asserts/src/Constraint/ArraySubset.php:85
/Users/sander/apps/phpunit-arraysubset-asserts/src/ArraySubsetAsserts.php:42
/Users/sander/apps/phpunit-arraysubset-asserts/tests/Unit/AssertTest.php:22Any ideas here?
winkbrace commented
Yeah, this package actually requires phpunit 8 because of the changed method signatures.
I've tried a couple of things, but in the end the only thing I can think of is mentioning this package in the suggest section of your composer.json if you can't require phpunit 8.
sandervanhooft commented
I think you're right @winkbrace , thanks!