Skip to content
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

[5.5] Ensure user is logged before expecting user instance type. #21377

Conversation

shulard
Copy link
Contributor

@shulard shulard commented Sep 25, 2017

When using the assertAuthenticatedAs method, if the user is not logged, the output message was strange. This PR introduce a new check to ensure the user is logged.

Before :

Tests\Feature\RegisterControllerTest::testRegisterWithSpecificRole with data set #3 (5)
The currently authenticated user is not who was expected
Failed asserting that Act\User Object (...) is an instance of class "Illuminate\Foundation\Testing\TestCase".

After :

Tests\Feature\RegisterControllerTest::testRegisterWithSpecificRole with data set #3 (5)
The current user is not authenticated.

Check the user is logged before expecting instance type.
@shulard
Copy link
Contributor Author

shulard commented Sep 25, 2017

The behaviour is the same on the 5.4 branch in the seeIsAuthenticatedAs method, I can make a PR on previous branches too.

@taylorotwell taylorotwell merged commit 5218ea6 into laravel:5.5 Sep 25, 2017
@GrahamCampbell GrahamCampbell changed the title Ensure user is logged before expecting user instance type. [5.5] Ensure user is logged before expecting user instance type. Sep 25, 2017
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.

None yet

2 participants