get('/media-stream/recordings/test_stream_video.webm'); $response->assertStatus(200); $response->assertHeader('Content-Type', 'video/webm'); $response->assertHeader('Accept-Ranges', 'bytes'); } finally { if (File::exists($testFile)) { File::delete($testFile); } } } public function test_poll_returns_media_stream_urls() { $user = User::factory()->create(); $interview = Interview::create([ 'candidate_name' => 'John Streamer', 'candidate_email' => 'stream@example.com', 'candidate_phone' => '1234567890', 'submission_unique_id' => 'stream_test_123', 'temp_password' => 'secret123', 'language' => 'python', 'status' => 'pending', 'expires_at' => now()->addDays(7), 'recording_path' => '/storage/recordings/stream_test_123.webm', 'recordings' => [ [ 'url' => '/storage/recordings/stream_test_123.webm', 'filename' => 'stream_test_123.webm', 'created_at' => now()->toIso8601String(), ] ], ]); $response = $this->actingAs($user)->get(route('interview.poll', $interview->id)); $response->assertStatus(200); $data = $response->json(); $this->assertNotEmpty($data['recordings']); $this->assertStringContainsString('/media-stream/recordings/stream_test_123.webm', $data['recordings'][0]['stream_url']); } }