mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-31 03:53:49 +00:00
Fix tests on PersonContextWithThirdParty: fix construction of PersonContextWithThirdPartyTest
This commit is contained in:
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Service\DocGenerator\PersonContextInterface;
|
||||
use Chill\PersonBundle\Service\DocGenerator\PersonContextWithThirdParty;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
@@ -83,9 +84,18 @@ final class PersonContextWithThirdPartyTest extends KernelTestCase
|
||||
$personContext->getData(Argument::type(DocGeneratorTemplate::class), Argument::type(Person::class), Argument::type('array'))
|
||||
->willReturn(['person' => 'data']);
|
||||
|
||||
$thirdPartyRepository = $this->prophesize(ThirdPartyRepository::class);
|
||||
$thirdPartyRepository->find(Argument::type('int'))->willReturn(new class () extends ThirdParty {
|
||||
public function getId(): ?int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
return new PersonContextWithThirdParty(
|
||||
$personContext->reveal(),
|
||||
$normalizer->reveal()
|
||||
$normalizer->reveal(),
|
||||
$thirdPartyRepository->reveal(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user