Skip to content

[12.x] Add tests for the AuthenticateSession Middleware #55900

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

imanghafoori1
Copy link
Contributor

@imanghafoori1 imanghafoori1 commented May 31, 2025

The class has no tests, this PR tries to fully cover the logic without over-mocking the dependencies.

  • Since the expectException(...) method of PHPUnit stops the test execution and no more checks are possible, I used try/catch to check the AuthenticationException.

@imanghafoori1 imanghafoori1 force-pushed the auth_middleware_test branch 3 times, most recently from e22f4c2 to e3e0667 Compare June 1, 2025 15:54
@imanghafoori1 imanghafoori1 changed the title [12.x] Add tests for AuthenticateSession Middleware [12.x] Fix deprecation + Add tests for AuthenticateSession Middleware Jun 1, 2025
@imanghafoori1 imanghafoori1 force-pushed the auth_middleware_test branch 2 times, most recently from 00ad742 to abd0839 Compare June 1, 2025 16:20
@imanghafoori1 imanghafoori1 changed the title [12.x] Fix deprecation + Add tests for AuthenticateSession Middleware [12.x] Fix deprecation + Add tests for AuthenticateSession Middleware Jun 1, 2025
@imanghafoori1 imanghafoori1 force-pushed the auth_middleware_test branch from abd0839 to ff98fce Compare June 1, 2025 16:50
@imanghafoori1 imanghafoori1 force-pushed the auth_middleware_test branch 2 times, most recently from b6c27b6 to a1450df Compare June 2, 2025 10:41
@imanghafoori1 imanghafoori1 force-pushed the auth_middleware_test branch from a1450df to f6b1cac Compare June 2, 2025 10:47
@imanghafoori1 imanghafoori1 changed the title [12.x] Fix deprecation + Add tests for AuthenticateSession Middleware [12.x] Add tests for AuthenticateSession Middleware Jun 2, 2025
@imanghafoori1 imanghafoori1 changed the title [12.x] Add tests for AuthenticateSession Middleware [12.x] Add tests for the AuthenticateSession Middleware Jun 2, 2025
@taylorotwell taylorotwell merged commit d8a228b into laravel:12.x Jun 2, 2025
59 checks passed
@imanghafoori1 imanghafoori1 deleted the auth_middleware_test branch June 5, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants