Closed vlauciani closed 8 months ago
Thanks @vlauciani !
Could you please add tests?
Hi @robsontenorio
Tests added! Could you check If all is ok?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
042483a
) to head (5db4c8a
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
There is a missing test case for empty returning. Check the report above.
The command composer test:coverage
to test "coverage" doesn't work; the file .coverage/clover.xml
is missing. It returns an error:
bash-5.1#
bash-5.1# composer test:coverage
> php -d pcov.enabled=1 ./vendor/bin/pest --coverage --coverage-clover=.coverage/clover.xml --coverage-html=.coverage
PASS KeycloakGuard\Tests\AuthenticateTest
✓ authenticates the user when requesting a private endpoint with token
✓ authenticates the user when requesting an public endpoint with token
✓ forbiden when request a protected endpoint without token
✓ laravel default interface for authenticated users
✓ laravel default interface for unathenticated users
✓ throws a exception when user is not found
✓ appends token to the user
✓ does not appends token to the user
✓ does not load user from database
✓ does not load user from database but appends decoded token
✓ throws a exception when resource access is not allowed by api
✓ ignores resources validation
✓ check user has role in resource
✓ check user no has role in resource
✓ prevent cross roles resources
✓ check user has any role in resource
✓ check user no has any role in resource
✓ prevent cross roles resources with any role
✓ check user has scope
✓ check user no has scope
✓ check user has any scope
✓ check user no has any scope
✓ custom user retrieve method
✓ throws a exception with invalid iat
✓ works with leeway
✓ authenticates with custom input key
✓ authentication prefers bearer token over with custom input key
Tests: 27 passed
Time: 0.95s
ERROR No code coverage driver is available.
Script php -d pcov.enabled=1 ./vendor/bin/pest --coverage --coverage-clover=.coverage/clover.xml --coverage-html=.coverage handling the test:coverage event returned with error code 1
bash-5.1#
bash-5.1#
Thanks !
Solve Issue: #106