fix: Fix tests.

This commit is contained in:
Pol Dellaiera 2021-11-18 14:33:14 +01:00
parent 7fd45d5735
commit 1509fcc2e9
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -1,14 +1,18 @@
<?php
declare(strict_types=1);
namespace Validator\Person;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter;
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenterValidator;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
class PersonHasCenterValidatorTest extends \Symfony\Component\Validator\Test\ConstraintValidatorTestCase
class PersonHasCenterValidatorTest extends ConstraintValidatorTestCase
{
public function testValidateRequired()
{
@ -42,9 +46,10 @@ class PersonHasCenterValidatorTest extends \Symfony\Component\Validator\Test\Con
'validation' => [
'center_required' => true
]
])
;
]);
return new PersonHasCenterValidator($parameterBag);
$centerResolverDispatcher = $this->createMock(CenterResolverDispatcher::class);
return new PersonHasCenterValidator($parameterBag, $centerResolverDispatcher);
}
}