-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Laravel 11 #233
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Was added to the L11 Authenticable contract
Also removed setting which have their default anyway, I consulted https://docs.phpunit.de/en/10.5/configuration.html for this. Note: removed `colors=true` nevertheless, don't think it's really necessary
phpunit does not want non-executable test classes, fixes: > `Class PHPOpenSourceSaver\JWTAuth\Test\Middleware\AbstractMiddlewareTest declared in /home/runner/work/jwt-auth/jwt-auth/tests/Middleware/AbstractMiddlewareTest.php is abstract`
Fixes: ``` 1) PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest::itShouldCheckWhetherATokenHasNotBeenBlacklisted Data Provider method PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest::blacklist_provider() is not static /home/runner/work/jwt-auth/jwt-auth/tests/BlacklistTest.php:198 2) PHPOpenSourceSaver\JWTAuth\Test\Http\ParserTest::itShouldHandleExcessWhitespaceFromTheAuthorizationHeader Data Provider method PHPOpenSourceSaver\JWTAuth\Test\Http\ParserTest::whitespaceProvider() is not static /home/runner/work/jwt-auth/jwt-auth/tests/Http/ParserTest.php:137 3) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldReturnFalseWhenProvidingAMalformedToken Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderMalformedTokens() is not static /home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:46 4) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldThrowAnExceptionWhenProvidingAMalformedToken Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderMalformedTokens() is not static /home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:56 5) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldReturnFalseWhenProvidingATokenWithWrongSegmentsNumber Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderTokensWithWrongSegmentsNumber() is not static /home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:69 6) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldThrowAnExceptionWhenProvidingAMalformedTokenWithWrongSegmentsNumber Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderTokensWithWrongSegmentsNumber() is not static ```
Fixes the following phpunit warning for now (which fails the workflow): > `No code coverage driver available` We still only upload the coverage when explicitly enabled.
All done, ready for review, please read the description and also the notes about coverage! I suggest we do this iteratively. |
3 tasks
I'll take a look at this today at evening or later this weekend. Thanks @mfn |
Closed
# Conflicts: # CHANGELOG.md
Messhias
approved these changes
Mar 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Good news: it works!
Due to the wide range of PHP, Laravel and phpunit versions we support here, some misc changes around the test procedure had to be done, as outlined below.
Ah yes, and of course php-cs-fixer also wants to say something, see also #232 alreadySummary of changes:
bump all L11 related dependencies incl. orchestra/testbench
Note: testbench requires
9.x-dev
but I also already added^9
once it's related (and then9.x-dev
can be removed)prefer-lowest
setting but I haven't looked closer as the current version "worked"adapted / fixed changelog
removed rector/rector
testbench has a dependency on some package which has a dependency on rector which wants a different version; in those cases packages wouldn't even install. But since for unit tests it isn't necessary -> I removed it
Should probably be updated to ^1 or removed, if not used regularly
the phpunit
--verbose
flag had to be removed, does not exist in phpunit 10 and it would refuse to runAdd new getAuthPasswordName for stub
Necessary because that method was added to L11
Authenticable
contract; does not impact older versionshad to run phpunit
--migrate-configuration
, the warning it emitted would break the workflowAlso removed setting which have their default anyway, I consulted
https://docs.phpunit.de/en/10.5/configuration.html for this.
Note: removed
colors=true
nevertheless, don't think it's really necessaryrename abstract class for tests
phpunit does not want non-executable test classes, fixes:
make data providers static
Fixes:
always make xdebug available
Fixes the following phpunit warning for now (which fails the workflow):
We still only upload the coverage when explicitly enabled.
Notes
This will make the whole setup much slimmer and easier to maintain going forward.
https://github.com/PHP-Open-Source-Saver/jwt-auth/actions/runs/7987659716/job/21810573995?pr=233#step:13:50
I haven't look yet but I suggest not to make this a blocker and maybe decide to slim down the whole support matrix, would make fixing coverage easier too