feat: GameGridProvider accepts config for hint types, watched-only, and retry logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-04-01 23:06:04 +02:00
parent 9c095a76eb
commit 94ff0ced63
2 changed files with 97 additions and 23 deletions

View File

@@ -53,4 +53,31 @@ class GameGridProviderTest extends TestCase
$this->assertSame('Academy Award for Best Actor (2020)', $result);
}
public function testGenerateHintRespectsAllowedTypes(): void
{
$movieRoleRepo = $this->createMock(MovieRoleRepository::class);
$movieRoleRepo->method('findOneRandomByActor')->willReturn(null);
$awardRepo = $this->createMock(AwardRepository::class);
$awardRepo->method('findOneRandomByActor')->willReturn(null);
$awardRepo->method('findOneRandomByActorAndTypes')->willReturn(null);
$generator = new GameGridProvider(
$this->createMock(ActorRepository::class),
$movieRoleRepo,
$this->createMock(MovieRepository::class),
$awardRepo,
$this->createMock(EntityManagerInterface::class),
);
$actor = new Actor();
$actor->setName('Test');
// Only allow 'award' type, but no awards exist → should return null
$method = new \ReflectionMethod($generator, 'generateHint');
$result = $method->invoke($generator, $actor, ['award'], null);
$this->assertNull($result);
}
}