messageBus = self::getContainer()->get(MessageBusInterface::class); $this->repository = self::getContainer()->get(ScrapingJobRepositoryInterface::class); } public function testGetScrapingStatus(): void { // Given $jobId = Uuid::uuid4()->toString(); $job = new ScrapingJob($jobId, 'manga-123', 1, 'source-789'); $job->addPage(new PageNumber(1), new ImageUrl('http://example.com/page1.jpg')); $job->addPage(new PageNumber(2), new ImageUrl('http://example.com/page2.jpg')); $this->repository->save($job); // When $response = static::createClient()->request('GET', '/api/scraping/jobs/'.$jobId.'/status'); // Then $this->assertResponseIsSuccessful(); $this->assertJsonContains([ 'jobId' => $jobId, 'status' => ScrapingStatus::IN_PROGRESS->value, 'progress' => 0 ]); } public function testGetScrapingStatusForNonExistentJob(): void { // When $response = static::createClient()->request('GET', '/api/scraping/jobs/non-existent-id/status', [ 'headers' => ['Accept' => 'application/json'] ]); // Then $this->assertResponseStatusCodeSame(404); } protected function tearDown(): void { parent::tearDown(); self::ensureKernelShutdown(); } }