mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
Delete client
This commit is contained in:
@@ -99,6 +99,36 @@ class OasisClientTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function user_delete_client()
|
||||
{
|
||||
Storage::fake('local');
|
||||
|
||||
$user = User::factory(User::class)
|
||||
->create(['role' => 'user']);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$avatar = UploadedFile::fake()
|
||||
->image('fake-image.jpg');
|
||||
|
||||
Storage::putFileAs('avatar', $avatar, 'fake-image.jpg');
|
||||
|
||||
$client = Client::factory(Client::class)
|
||||
->create([
|
||||
'avatar' => 'avatar/fake-image.jpg',
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
|
||||
$this->deleteJson("/api/oasis/clients/$client->id")
|
||||
->assertStatus(204);
|
||||
|
||||
Storage::disk('local')
|
||||
->assertMissing('avatar/fake-image.jpg');
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user