Last active
May 22, 2018 20:57
-
-
Save DCzajkowski/e8ea9d02ce3a490e9109c7160a2fbb3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
// ... | |
class LoginTest extends TestCase | |
{ | |
// ... | |
public function test_remember_me_functionality() | |
{ | |
$user = factory(User::class)->create([ | |
'id' => random_int(1, 100), | |
'password' => bcrypt($password = 'i-love-laravel'), | |
]); | |
$response = $this->post('/login', [ | |
'email' => $user->email, | |
'password' => $password, | |
'remember' => 'on', | |
]); | |
$response->assertRedirect('/home'); | |
// cookie assertion goes here | |
$this->assertAuthenticatedAs($user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment