Skip to content

A self-hosted media server and file management system

fix: storage cache path does not exist by default and fails config tests

aminnausin22ad0077d5d6
diff --git a/tests/Feature/Server/ServerConfigControllerTest.php b/tests/Feature/Server/ServerConfigControllerTest.php
index 60a482bb..be8c2dcf 100644
--- a/tests/Feature/Server/ServerConfigControllerTest.php
+++ b/tests/Feature/Server/ServerConfigControllerTest.php
@@ -6,6 +6,7 @@ use App\Models\ServerConfig;
use App\Models\User;
use App\Services\Server\QueueControlService;
use Illuminate\Foundation\Testing\RefreshDatabase;
+use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class ServerConfigControllerTest extends TestCase {
@@ -140,6 +141,12 @@ class ServerConfigControllerTest extends TestCase {
}
public function test_update_storage_normalises_paths(): void {
+ $cachePath = Storage::disk('local')->path('cache');
+
+ if (!is_dir($cachePath)) {
+ mkdir($cachePath, 0755, true);
+ }
+
$this->actingAs($this->adminUser())->patchJson('/api/config/storage', ['cache_path' => 'storage\\cache/'])->assertNoContent();
$this->assertDatabaseHas('server_configs', ['key' => 'cache_path', 'value' => 'storage/cache']);