-
Notifications
You must be signed in to change notification settings - Fork 52
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
User login test case #3384
base: master
Are you sure you want to change the base?
User login test case #3384
Conversation
Passing run #7849 ↗︎
Details:
Review all test suite changes for PR #3384 ↗︎ |
Coverage report for commit: ff24d03
Summary - Lines: 3.35% | Methods: 5.49%
🤖 comment via lucassabreu/comment-coverage-clover |
Codecov ReportAll modified and coverable lines are covered by tests ✅ see 3 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
tests/Feature/UserLogInTest.php
Outdated
public function test_example() | ||
{ | ||
$this->userLogInFailedWithWrongPassword(); | ||
$this->userLogIn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the test function in this file
tests/TestCase.php
Outdated
protected function userLogIn() | ||
{ | ||
$password = 'admin'; | ||
$user = User::factory()->create([ | ||
'name' => 'User', | ||
'email' => '[email protected]', | ||
'password' => bcrypt($password), | ||
]); | ||
|
||
$response = $this->post('/login', [ | ||
'email' => $user->email, | ||
'password' => $password, | ||
]); | ||
|
||
$response->assertRedirect('/home'); | ||
$this->assertAuthenticatedAs($user); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove them from here.
tests/Feature/UserLogInTest.php
Outdated
$user = User::factory()->create([ | ||
'name' => 'User', | ||
'email' => '[email protected]', | ||
'password' => bcrypt($password), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'password' => bcrypt($password), | |
'password' => Hash::make($password), |
tests/Feature/UserLogInTest.php
Outdated
$user = User::factory()->create([ | ||
'name' => 'admin', | ||
'email' => '[email protected]', | ||
'password' => bcrypt('Admin'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'password' => bcrypt('Admin'), | |
'password' => Hash::make('Admin'), |
In this PR we are now implementing the Test cases for User login.