AllowMockObjectsWhereParentClassRector

Add #[AllowMockObjectsWithoutExpectations] attribute to PHPUnit test classes with a 3rd party test case, that provides any mocks

 use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

+#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
 final class SomeTest extends ConstraintValidatorTestCase
 {
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit120\Rector\Class_\AllowMockObjectsWhereParentClassRector;

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