getStatusCode() !== $statusCode) { dump($response->getContent()); } $response->assertStatus($statusCode); } /** * Captures the options passed to temporaryUrl on the private disk. * * @return Closure(): (array|null) */ protected function captureTemporaryUrlOptions(): Closure { $captured = null; $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; }; } }