mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
tests: Fix "...Class "Chill\MainBundle\Security\Resolver\CenterResolverDispatcher" is declared "final" and cannot be mocked....".
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Validator\Constraints\Person;
|
||||
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
class PersonHasCenterValidator extends \Symfony\Component\Validator\ConstraintValidator
|
||||
class PersonHasCenterValidator extends ConstraintValidator
|
||||
{
|
||||
private bool $centerRequired;
|
||||
private CenterResolverDispatcher $centerResolverDispatcher;
|
||||
private CenterResolverDispatcherInterface $centerResolverDispatcher;
|
||||
|
||||
public function __construct(ParameterBagInterface $parameterBag, CenterResolverDispatcher $centerResolverDispatcher)
|
||||
public function __construct(ParameterBagInterface $parameterBag, CenterResolverDispatcherInterface $centerResolverDispatcher)
|
||||
{
|
||||
$this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required'];
|
||||
$this->centerResolverDispatcher = $centerResolverDispatcher;
|
||||
@@ -37,8 +40,7 @@ class PersonHasCenterValidator extends \Symfony\Component\Validator\ConstraintVa
|
||||
->context
|
||||
->buildViolation($constraint->message)
|
||||
->atPath('center')
|
||||
->addViolation()
|
||||
;
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user