mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-20 02:22:28 +08:00
25 lines
766 B
PHP
25 lines
766 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\User;
|
|
use Laravel\Jetstream\Features;
|
|
|
|
test('user accounts can be deleted', function () {
|
|
$this->actingAs($user = User::factory()->create());
|
|
|
|
$this->delete('/user', [
|
|
'password' => 'password',
|
|
]);
|
|
|
|
expect($user->fresh())->toBeNull();
|
|
})->skip(fn () => !Features::hasAccountDeletionFeatures(), 'Account deletion is not enabled.');
|
|
|
|
test('correct password must be provided before account can be deleted', function () {
|
|
$this->actingAs($user = User::factory()->create());
|
|
|
|
$this->delete('/user', [
|
|
'password' => 'wrong-password',
|
|
]);
|
|
|
|
expect($user->fresh())->not?->toBeNull();
|
|
})->skip(fn () => !Features::hasAccountDeletionFeatures(), 'Account deletion is not enabled.');
|