Add phpunit 12 support #9
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#8
Description
So
IsType::TYPE_ARRAYdoesn't exist in PHPUnit 12, which causes most of the errors with simply adding PHPUnit 12 as supported incomposer.json.The correct way to fix this is using isArray() introduced in PHPUnit 11.
However, that doesn't exist in PHPUnit 10, which means we drop support for Laravel 10.
Another way I tried to fix this is to keep the
new IsType()withNativeType::Array, but that also doesn't exist in earlier versions.In the end, this is the way I went with, but it still has caveats (this example is from
FilterAssertions.php):I have created a fork of this repo and implemented this... gory fix. It passes the tests (finally), but undoubtedly there's a more beautiful / better way to do this that I just simply don't see at the moment.
Maybe someone with fresh eyes can chime in here!
Testing
I have tested this only using the Github Actions workflow by temporarily allowing my branch to be picked up by GH Actions. I've reverted that part of this PR.