Fix test on CalendarType: use the real IdToEntityDataTransformer, mocking the repository

This commit is contained in:
2023-08-28 15:22:08 +02:00
parent 2c83b4c912
commit 667104a595
4 changed files with 38 additions and 15 deletions

View File

@@ -34,8 +34,11 @@ class IdToEntityDataTransformer implements DataTransformerInterface
/**
* @param Closure $getId
*/
public function __construct(private readonly ObjectRepository $repository, private readonly bool $multiple = false, ?callable $getId = null)
{
public function __construct(
private readonly ObjectRepository $repository,
private readonly bool $multiple = false,
?callable $getId = null
) {
$this->getId = $getId ?? static fn (object $o) => $o->getId();
}