diff --git a/tests/Unit/Validator/Constraints/RouteDefaultsTwigValidatorTest.php b/tests/Unit/Validator/Constraints/RouteDefaultsTwigValidatorTest.php index 3d0c8941..9182ef13 100644 --- a/tests/Unit/Validator/Constraints/RouteDefaultsTwigValidatorTest.php +++ b/tests/Unit/Validator/Constraints/RouteDefaultsTwigValidatorTest.php @@ -15,8 +15,10 @@ use Symfony\Cmf\Bundle\RoutingBundle\Validator\Constraints\RouteDefaults; use Symfony\Cmf\Bundle\RoutingBundle\Validator\Constraints\RouteDefaultsTwigValidator; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; +use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\ConstraintValidatorInterface; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Test\ConstraintViolationAssertion; use Twig\Loader\LoaderInterface; class RouteDefaultsTwigValidatorTest extends ConstraintValidatorTestCase @@ -66,7 +68,7 @@ public function testControllerPathViolation(): void $this->validator->validate(['_controller' => 'NotExistingBundle:Foo:bar'], new RouteDefaults()); - $this->buildViolation('Invalid controller')->assertRaised(); + (new ConstraintViolationAssertion($this->context, 'Invalid controller', new NotNull()))->assertRaised(); } public function testCorrectTemplate(): void @@ -94,8 +96,9 @@ public function testTemplateViolation(): void new RouteDefaults(['message' => 'my message']) ); - $this->buildViolation('my message') + (new ConstraintViolationAssertion($this->context, 'my message', new NotNull())) ->setParameter('%name%', 'NotExistingBundle:Foo:bar.html.twig') - ->assertRaised(); + ->assertRaised() + ; } }