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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user