Updated Laravel to v13

This commit is contained in:
Constantin Graf
2026-09-22 15:32:05 +02:00
committed by Constantin Graf
parent 12cc3f27f8
commit 2dadf1ef02
36 changed files with 849 additions and 567 deletions

View File

@@ -8,6 +8,7 @@ use Closure;
use DateTimeInterface;
use Illuminate\Support\Facades\Storage;
use Illuminate\Testing\TestResponse;
use Mockery;
use Tests\TestCaseWithDatabase;
class ApiEndpointTestAbstract extends TestCaseWithDatabase
@@ -21,21 +22,23 @@ class ApiEndpointTestAbstract extends TestCaseWithDatabase
}
/**
* Replaces the temporary URL builder of the private disk to capture the options
* passed to temporaryUrl. Returns a closure that yields the captured options.
* Captures the options passed to temporaryUrl on the private disk.
*
* @return Closure(): (array<string, mixed>|null)
*/
protected function captureTemporaryUrlOptions(): Closure
{
$captured = null;
Storage::disk(config('filesystems.private'))->buildTemporaryUrlsUsing(
$diskName = config('filesystems.private');
$disk = Mockery::mock(Storage::disk($diskName))->makePartial();
$disk->shouldReceive('temporaryUrl')->andReturnUsing(
function (string $path, DateTimeInterface $expiration, array $options) use (&$captured): string {
$captured = $options;
return 'https://storage.fake/'.$path;
}
);
Storage::set($diskName, $disk);
return function () use (&$captured): ?array {
return $captured;