ConstraintValidatorValidateToValidateInContextRector

Migrate deprecated ConstraintValidatorInterface::validate() in ConstraintValidatorTestCase tests to $this->validate(), otherwise to validateInContext() (Symfony 8.1+).

 use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

 final class SomeValidatorTest extends ConstraintValidatorTestCase
 {
     public function test(): void
     {
-        $this->validator->validate($value, $constraint);
+        $this->validate($value, $constraint);
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony81\Rector\MethodCall\ConstraintValidatorValidateToValidateInContextRector;

return RectorConfig::configure()
    ->withRules([
        ConstraintValidatorValidateToValidateInContextRector::class,
    ]);