FileUploadConfiguration: :disk() always returns tmp-for-tests under PHPUnit; assert config + isUsingS3() instead. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
572 B
PHP
15 lines
572 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Livewire\Features\SupportFileUploads\FileUploadConfiguration;
|
|
|
|
it('keeps livewire temporary uploads on the local disk when the default filesystem is r2', function (): void {
|
|
config(['filesystems.default' => 'r2']);
|
|
|
|
// Livewire swaps FileUploadConfiguration::disk() to tmp-for-tests under PHPUnit;
|
|
// isUsingS3() still reads the configured temp disk and drives signed R2 uploads.
|
|
expect(config('livewire.temporary_file_upload.disk'))->toBe('local')
|
|
->and(FileUploadConfiguration::isUsingS3())->toBeFalse();
|
|
});
|