tests/Feature/ProfileTest.php: test that user can not set an empty password hash.
This commit is contained in:
parent
52f565f04b
commit
099115d613
1 changed files with 20 additions and 0 deletions
|
|
@ -85,6 +85,26 @@ class ProfileTest extends TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
public function test_user_can_not_set_empty_password_hash()
|
||||
{
|
||||
$user = User::factory()->create([ 'password' => NULL ]);
|
||||
|
||||
$response = $this->actingAs($user)
|
||||
->post(route('profile.update'), [
|
||||
'username' => $user->username,
|
||||
'current_password' => '',
|
||||
'password' => '',
|
||||
'password_confirmation' => ''
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('profile.index'));
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'id' => $user->id,
|
||||
'password' => NULL
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_guest_can_not_update()
|
||||
{
|
||||
$response = $this->post(route('profile.update'), [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue