user = User::factory()->create(); $this->changer = app(UpdateUserPassword::class); // Log in the user $this->actingAs($this->user); }); it('updates a users password', function () { $this->changer->update($this->user, ['password' => 'password123', 'password_confirmation' => 'password123', 'current_password' => 'password']); expect(Hash::check('password123', $this->user->password))->toBeTrue(); });