setName('Oscar')->setPattern('Academy Award'); $actor = new Actor(); $actor->setName('Test Actor'); $award = new Award(); $award->setName('Academy Award for Best Actor'); $award->setYear(2020); $award->setActor($actor); $award->setAwardType($awardType); $awardRepository = $this->createMock(AwardRepository::class); $awardRepository->method('find')->with(42)->willReturn($award); $generator = new GameGridProvider( $this->createMock(ActorRepository::class), $this->createMock(MovieRoleRepository::class), $this->createMock(MovieRepository::class), $awardRepository, $this->createMock(EntityManagerInterface::class), ); $row = new GameRow(); $row->setHintType('award'); $row->setHintData('42'); // Use reflection to test the private resolveHintText method $method = new \ReflectionMethod($generator, 'resolveHintText'); $result = $method->invoke($generator, $row); $this->assertSame('Academy Award for Best Actor (2020)', $result); } }