mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-11-13 09:38:48 +01:00
36 lines
979 B
PHP
36 lines
979 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Console\Commands\Storage\Admin\UserDumpCommand;
|
|
use App\Constants\Config\DumpConstants;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Illuminate\Support\Facades\Config;
|
|
use Illuminate\Support\Facades\Date;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
pest()->use(WithFaker::class);
|
|
|
|
test('database dump output', function (): void {
|
|
Storage::fake('local');
|
|
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
|
|
|
Date::setTestNow(fake()->iso8601());
|
|
|
|
$this->artisan(UserDumpCommand::class)
|
|
->assertSuccessful()
|
|
->expectsOutputToContain('has been created');
|
|
});
|
|
|
|
test('database dump file', function (): void {
|
|
$local = Storage::fake('local');
|
|
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
|
|
|
Date::setTestNow(fake()->iso8601());
|
|
|
|
$this->artisan(UserDumpCommand::class)->run();
|
|
|
|
expect($local->allFiles())->toBeEmpty();
|
|
expect($fs->allFiles())->toHaveCount(1);
|
|
});
|