mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Fix test on CalendarType: use the real IdToEntityDataTransformer, mocking the repository
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -24,11 +24,8 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class PrivateCommentType extends AbstractType
|
||||
{
|
||||
protected UserInterface $user;
|
||||
|
||||
public function __construct(TokenStorageInterface $tokenStorage, protected PrivateCommentDataMapper $dataMapper)
|
||||
public function __construct(protected PrivateCommentDataMapper $dataMapper)
|
||||
{
|
||||
$this->user = $tokenStorage->getToken()->getUser();
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
|
Reference in New Issue
Block a user