Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user = factory(AppUser::class)->create(['password' => Hash::make('password')]);
- $this->actingAs($user);
- $response = $this->call('PUT', '/user/update-password', array(
- '_token' => csrf_token(),
- 'current_password' => 'password',
- 'new_password' => 'newone',
- 'repeat_new_password' => 'newone',
- ));
- $response->assertStatus(302);
- $this->assertDatabaseHas('users', ['name' => $user->name, 'password' => Hash::make('newone')]);
- ....
- $user->password = Hash::make($request->new_password);
- $user->save();
- ....
Add Comment
Please, Sign In to add comment