File tree Expand file tree Collapse file tree
rules-tests/PHPUnit120/Rector/Class_/AllowMockObjectsWhereParentClassRector/Fixture
rules/PHPUnit120/Rector/Class_
stubs/Symfony/Component/Form/Test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \PHPUnit \Tests \PHPUnit120 \Rector \Class_ \AllowMockObjectsWhereParentClassRector \Fixture ;
4+
5+ use Symfony \Component \Validator \Test \ConstraintValidatorTestCase ;
6+
7+ abstract class IntermediateConstraintValidatorBase extends ConstraintValidatorTestCase
8+ {
9+ }
10+
11+ final class SkipConstraintValidatorTestCaseViaIntermediate extends IntermediateConstraintValidatorBase
12+ {
13+ private \PHPUnit \Framework \MockObject \MockObject $ someMock ;
14+ }
Original file line number Diff line number Diff line change 22
33namespace Rector \PHPUnit \Tests \PHPUnit120 \Rector \Class_ \AllowMockObjectsWhereParentClassRector \Fixture ;
44
5- use Symfony \Component \Validator \Test \ConstraintValidatorTestCase ;
5+ use Symfony \Component \Form \Test \TypeTestCase ;
66
7- final class SomeClass extends ConstraintValidatorTestCase
7+ final class SomeClass extends TypeTestCase
88{
99 private \PHPUnit \Framework \MockObject \MockObject $ someMock ;
1010}
@@ -15,10 +15,10 @@ final class SomeClass extends ConstraintValidatorTestCase
1515
1616namespace Rector \PHPUnit \Tests \PHPUnit120 \Rector \Class_ \AllowMockObjectsWhereParentClassRector \Fixture ;
1717
18- use Symfony \Component \Validator \Test \ConstraintValidatorTestCase ;
18+ use Symfony \Component \Form \Test \TypeTestCase ;
1919
2020#[\PHPUnit \Framework \Attributes \AllowMockObjectsWithoutExpectations]
21- final class SomeClass extends ConstraintValidatorTestCase
21+ final class SomeClass extends TypeTestCase
2222{
2323 private \PHPUnit \Framework \MockObject \MockObject $ someMock ;
2424}
Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ final class AllowMockObjectsWhereParentClassRector extends AbstractRector
3030 /**
3131 * @var string[]
3232 */
33- private const array PARENT_CLASSES = [
34- PHPUnitClassName::SYMFONY_CONSTRAINT_VALIDATOR_TEST_CASE ,
35- PHPUnitClassName::SYMFONY_TYPE_TEST_CASE ,
36- ];
33+ private const array PARENT_CLASSES = [PHPUnitClassName::SYMFONY_TYPE_TEST_CASE ];
3734
3835 public function __construct (
3936 private readonly TestsNodeAnalyzer $ testsNodeAnalyzer ,
@@ -75,18 +72,18 @@ public function getRuleDefinition(): RuleDefinition
7572 [
7673 new CodeSample (
7774 <<<'CODE_SAMPLE'
78- use Symfony\Component\Validator \Test\ConstraintValidatorTestCase ;
75+ use Symfony\Component\Form \Test\TypeTestCase ;
7976
80- final class SomeTest extends ConstraintValidatorTestCase
77+ final class SomeTest extends TypeTestCase
8178{
8279}
8380CODE_SAMPLE
8481 ,
8582 <<<'CODE_SAMPLE'
86- use Symfony\Component\Validator \Test\ConstraintValidatorTestCase ;
83+ use Symfony\Component\Form \Test\TypeTestCase ;
8784
8885#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
89- final class SomeTest extends ConstraintValidatorTestCase
86+ final class SomeTest extends TypeTestCase
9087{
9188}
9289CODE_SAMPLE
Original file line number Diff line number Diff line change @@ -27,8 +27,6 @@ final class PHPUnitClassName
2727
2828 public const string STUB = 'PHPUnit\Framework\MockObject\Stub ' ;
2929
30- public const string SYMFONY_CONSTRAINT_VALIDATOR_TEST_CASE = 'Symfony\Component\Validator\Test\ConstraintValidatorTestCase ' ;
31-
3230 public const string SYMFONY_TYPE_TEST_CASE = 'Symfony\Component\Form\Test\TypeTestCase ' ;
3331
3432 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Symfony \Component \Form \Test ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+
7+ abstract class TypeTestCase extends TestCase
8+ {
9+ }
You can’t perform that action at this time.
0 commit comments