Guest User

Untitled

a guest
May 16th, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $user = factory(AppUser::class)->create(['password' => Hash::make('password')]);
  2. $this->actingAs($user);
  3.  
  4. $response = $this->call('PUT', '/user/update-password', array(
  5. '_token' => csrf_token(),
  6. 'current_password' => 'password',
  7. 'new_password' => 'newone',
  8. 'repeat_new_password' => 'newone',
  9. ));
  10. $response->assertStatus(302);
  11.  
  12. $this->assertDatabaseHas('users', ['name' => $user->name, 'password' => Hash::make('newone')]);
  13.  
  14. ....
  15. $user->password = Hash::make($request->new_password);
  16. $user->save();
  17. ....
Add Comment
Please, Sign In to add comment