create(); $uploadId = (string) Str::uuid(); DB::table('uploads')->insert([ 'id' => $uploadId, 'user_id' => $user->id, 'type' => 'archive', 'status' => 'draft', 'is_scanned' => true, 'has_tags' => false, 'created_at' => now(), 'updated_at' => now(), ]); // archive path with no screenshot uses placeholder path in PreviewService $job = new PreviewGenerationJob($uploadId); $job->handle(app(\App\Services\Upload\PreviewService::class)); $this->assertDatabaseHas('uploads', [ 'id' => $uploadId, ]); Bus::assertDispatched(TagAnalysisJob::class, function (TagAnalysisJob $queuedJob) use ($uploadId) { $reflect = new ReflectionClass($queuedJob); $property = $reflect->getProperty('uploadId'); $property->setAccessible(true); return $property->getValue($queuedJob) === $uploadId; }); });