mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-10-12 15:53:19 +01:00
Updated Laravel to v13
This commit is contained in:
committed by
Constantin Graf
parent
12cc3f27f8
commit
2dadf1ef02
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user