<?php

namespace Tests\Feature;

use Tests\TestCase;

class StorageConfigurationTest extends TestCase
{
    public function test_public_disk_is_configured_for_public_storage_urls(): void
    {
        $publicDisk = config('filesystems.disks.public');

        $this->assertSame('local', $publicDisk['driver']);
        $this->assertSame(storage_path('app/public'), $publicDisk['root']);
        $this->assertSame('public', $publicDisk['visibility']);
        $this->assertStringEndsWith('/storage', $publicDisk['url']);
    }

    public function test_storage_link_configuration_points_public_storage_to_app_public(): void
    {
        $links = config('filesystems.links');

        $this->assertArrayHasKey(public_path('storage'), $links);
        $this->assertSame(storage_path('app/public'), $links[public_path('storage')]);
    }
}
