daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest May 16th, 2018 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ....
RAW Paste Data
Top