Skip to content

Commit 4c54c08

Browse files
Add test to backup downloads with different disks
1 parent ba93960 commit 4c54c08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Feature/DownloadBackupTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Illuminate\Support\Facades\Storage;
34
use Itiden\Backup\Contracts\Repositories\BackupRepository;
45
use Itiden\Backup\Facades\Backuper;
56

@@ -31,7 +32,10 @@
3132
expect($responseJson->status())->toBe(403);
3233
});
3334

34-
it('can be downloaded by a user with download backups permission', function () {
35+
it('can be downloaded by a user with download backups permission', function (string $disk) {
36+
Storage::fake($disk);
37+
config()->set('backup.destination.disk', $disk);
38+
3539
$backup = Backuper::backup();
3640

3741
$user = user();
@@ -43,7 +47,7 @@
4347
$response = get(cp_route('api.itiden.backup.download', $backup->timestamp));
4448

4549
expect($response)->assertDownload();
46-
});
50+
})->with(['s3', 'local']);
4751

4852
it('adds a download action to the metadata', function () {
4953
$backup = Backuper::backup();

0 commit comments

Comments
 (0)