Files
animethemes-server/tests/Feature/Actions/Storage/Admin/Dump/DumpDocumentTest.php
T
2026-04-23 00:48:53 -03:00

31 lines
861 B
PHP

<?php
declare(strict_types=1);
use App\Actions\Storage\Admin\Dump\DumpDocumentAction;
use App\Constants\Config\DumpConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Admin\Dump;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\Storage;
uses(WithFaker::class);
test('database dump output', function (): void {
$local = Storage::fake('local');
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
Date::setTestNow(fake()->iso8601());
$action = new DumpDocumentAction();
$result = $action->handle();
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
$this->assertEmpty($local->allFiles());
$this->assertCount(1, $fs->allFiles());
$this->assertDatabaseCount(Dump::class, 1);
});