actingAs($user = User::factory()->createOne()); Livewire::test(DeleteUserForm::class) ->set('password', 'password') ->call('deleteUser'); static::assertSoftDeleted($user->fresh()); } /** * Correct password must be provided before account can be deleted. * * @return void */ public function testCorrectPasswordMustBeProvidedBeforeAccountCanBeDeleted(): void { if (! Features::hasAccountDeletionFeatures()) { static::markTestSkipped('Account deletion is not enabled.'); } $this->actingAs($user = User::factory()->createOne()); Livewire::test(DeleteUserForm::class) ->set('password', 'wrong-password') ->call('deleteUser') ->assertHasErrors(['password']); static::assertNotSoftDeleted($user->fresh()); } }