getStatusCode() !== $statusCode) { dump($response->getContent()); } $response->assertStatus($statusCode); } /** * Replaces the temporary URL builder of the private disk to capture the options * passed to temporaryUrl. Returns a closure that yields the captured options. * * @return Closure(): (array|null) */ protected function captureTemporaryUrlOptions(): Closure { $captured = null; Storage::disk(config('filesystems.private'))->buildTemporaryUrlsUsing( function (string $path, DateTimeInterface $expiration, array $options) use (&$captured): string { $captured = $options; return 'https://storage.fake/'.$path; } ); return function () use (&$captured): ?array { return $captured; }; } }