From 7aa03abef005834908d03800ec82f2915a4f0972 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 20 May 2024 18:40:57 +0200 Subject: [PATCH 01/25] Add custom mutator command --- src/Command/CustomMutatorCommand.php | 125 +++++++++++++++++++ src/CustomMutator/templates/__Name__.php | 50 ++++++++ src/CustomMutator/templates/__Name__Test.php | 80 ++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 src/Command/CustomMutatorCommand.php create mode 100644 src/CustomMutator/templates/__Name__.php create mode 100644 src/CustomMutator/templates/__Name__Test.php diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php new file mode 100644 index 0000000000..4be8364698 --- /dev/null +++ b/src/Command/CustomMutatorCommand.php @@ -0,0 +1,125 @@ +setName('custom-mutator') + ->setDescription('Creates a cusotm mutator') + ->addArgument('Mutator name', InputArgument::OPTIONAL); + } + + protected function executeCommand(IO $io): bool + { + $mutator = $io->getInput()->getArgument('Mutator name'); + + if ($mutator === null) { + $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); + $question->setValidator(function (string|null $answer): string { + if ($answer === null || trim($answer) === '') { + throw new \RuntimeException('Mutator name is mandaory.'); + } + + return $answer; + }); + $mutator = $io->askQuestion( + $question, + ); + } + + $mutator = ucfirst((string) $mutator); + + // find all files in templates directory + $finder = Finder::create() + ->files() + ->in(__DIR__ . '/../CustomMutator/templates'); + + $currentDirectory = getcwd(); + + $generatedFilePaths = []; + + $fileInfos = iterator_to_array($finder->getIterator()); + $fileSystem = $this->getApplication()->getContainer()->getFileSystem(); + + foreach ($fileInfos as $fileInfo) { + // replace __Name__ with $mutator + $newContent = $this->replaceNameVariable($mutator, $fileInfo->getContents()); + $replacedNamePath = $this->replaceNameVariable($mutator, $fileInfo->getRelativePathname()); + + $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; + + $fileSystem->dumpFile($newFilePath, $newContent); + + $generatedFilePaths[] = $newFilePath; + } + + $io->title('Generated files'); + $io->listing($generatedFilePaths); + $io->success( + sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutator) + ); + + return true; + } + + private function replaceNameVariable(string $rectorName, string $contents): string + { + return str_replace('__Name__', $rectorName, $contents); + } +} diff --git a/src/CustomMutator/templates/__Name__.php b/src/CustomMutator/templates/__Name__.php new file mode 100644 index 0000000000..412ca2baf8 --- /dev/null +++ b/src/CustomMutator/templates/__Name__.php @@ -0,0 +1,50 @@ + + */ + public function mutate(Node $node): iterable + { + // TODO: update the logic to return mutated nodes + yield $node; + } + + public static function getDefinition(): Definition + { + return new Definition( + <<<'TXT' + TODO: add description of this mutator here + TXT + , + MutatorCategory::ORTHOGONAL_REPLACEMENT, + null, + <<<'DIFF' + - TODO: show the source code before mutation + + TODO: show the source code after mutation + DIFF, + ); + } + + public function getName(): string + { + return self::class; + } +} diff --git a/src/CustomMutator/templates/__Name__Test.php b/src/CustomMutator/templates/__Name__Test.php new file mode 100644 index 0000000000..abad38c707 --- /dev/null +++ b/src/CustomMutator/templates/__Name__Test.php @@ -0,0 +1,80 @@ +doTest($input, $expected); + } + + public static function mutationsProvider(): iterable + { + // TODO: write original and mutated code in each cases + // TODO: if you want to test that the code is not mutated, just leave one element (source code) in the array + // TODO: if mutator produces N mutants, the second array item must be an array of mutated codes + + yield 'It mutates a simple case' => [ + <<<'PHP' + [ +// <<<'PHP' +// [ +// <<<'PHP' +// Date: Mon, 20 May 2024 18:41:17 +0200 Subject: [PATCH 02/25] Move `BaseMutatorTestCase` to Infection\Testing namespace --- composer.lock | 2 +- infection.json5 | 2 +- src/Console/Application.php | 2 ++ .../Testing}/BaseMutatorTestCase.php | 36 +++++++++++-------- .../Mutator => src/Testing}/MutatorName.php | 4 +-- .../Testing}/SimpleMutation.php | 2 +- .../SimpleMutationsCollectorVisitor.php | 2 +- .../Testing}/SingletonContainer.php | 2 +- .../Testing}/SourceTestClassNameScheme.php | 2 +- .../Testing}/StringNormalizer.php | 4 +-- tests/phpunit/AutoReview/ContainerTest.php | 8 ++--- .../EnvTestCasesProvider.php | 12 +++---- .../IntegrationGroupProvider.php | 14 ++++---- .../ProjectCode/ProjectCodeTest.php | 16 ++++----- .../SourceTestClassNameSchemeTest.php | 1 + tests/phpunit/Command/DescribeCommandTest.php | 2 +- tests/phpunit/Command/RunCommandTest.php | 2 +- .../ConfigurationFactoryTest.php | 4 +-- tests/phpunit/Console/E2ETest.php | 36 +++++++++---------- tests/phpunit/ContainerTest.php | 1 + .../Logger/CreateMetricsCalculator.php | 2 +- .../Html/StrykerHtmlReportBuilderTest.php | 12 +++---- .../Metrics/CreateMutantExecutionResult.php | 4 +-- .../SortableMutantExecutionResultsTest.php | 4 +-- .../phpunit/Mutant/MutantCodeFactoryTest.php | 4 +-- .../MutantExecutionResultFactoryTest.php | 2 +- .../Mutant/MutantExecutionResultTest.php | 4 +-- tests/phpunit/Mutant/MutantFactoryTest.php | 2 +- tests/phpunit/Mutant/MutantTest.php | 4 +-- .../Mutation/FileMutationGeneratorTest.php | 10 +++--- tests/phpunit/Mutation/MutationTest.php | 6 ++-- .../Arithmetic/AssignmentEqualTest.php | 2 +- .../Mutator/Arithmetic/AssignmentTest.php | 2 +- .../Mutator/Arithmetic/BitwiseAndTest.php | 2 +- .../Mutator/Arithmetic/BitwiseNotTest.php | 2 +- .../Mutator/Arithmetic/BitwiseOrTest.php | 2 +- .../Mutator/Arithmetic/BitwiseXorTest.php | 2 +- .../Mutator/Arithmetic/DecrementTest.php | 2 +- .../Mutator/Arithmetic/DivEqualTest.php | 2 +- .../Mutator/Arithmetic/DivisionTest.php | 2 +- .../Mutator/Arithmetic/ExponentiationTest.php | 2 +- .../Mutator/Arithmetic/IncrementTest.php | 2 +- .../Mutator/Arithmetic/MinusEqualTest.php | 2 +- .../phpunit/Mutator/Arithmetic/MinusTest.php | 2 +- .../Mutator/Arithmetic/ModEqualTest.php | 2 +- .../Mutator/Arithmetic/ModulusTest.php | 2 +- .../Mutator/Arithmetic/MulEqualTest.php | 2 +- .../Mutator/Arithmetic/MultiplicationTest.php | 2 +- .../Mutator/Arithmetic/PlusEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/PlusTest.php | 2 +- .../Mutator/Arithmetic/PowEqualTest.php | 2 +- .../Mutator/Arithmetic/RoundingFamilyTest.php | 2 +- .../Mutator/Arithmetic/ShiftLeftTest.php | 2 +- .../Mutator/Arithmetic/ShiftRightTest.php | 2 +- .../phpunit/Mutator/Boolean/ArrayItemTest.php | 2 +- .../Mutator/Boolean/EqualIdenticalTest.php | 2 +- .../Mutator/Boolean/FalseValueTest.php | 2 +- .../Mutator/Boolean/IdenticalEqualTest.php | 2 +- .../Mutator/Boolean/InstanceOf_Test.php | 2 +- .../LogicalAndAllSubExprNegationTest.php | 2 +- .../Boolean/LogicalAndNegationTest.php | 2 +- .../LogicalAndSingleSubExprNegationTest.php | 2 +- .../Mutator/Boolean/LogicalAndTest.php | 2 +- .../Mutator/Boolean/LogicalLowerAndTest.php | 2 +- .../Mutator/Boolean/LogicalLowerOrTest.php | 2 +- .../Mutator/Boolean/LogicalNotTest.php | 2 +- .../LogicalOrAllSubExprNegationTest.php | 2 +- .../Mutator/Boolean/LogicalOrNegationTest.php | 2 +- .../LogicalOrSingleSubExprNegationTest.php | 2 +- .../phpunit/Mutator/Boolean/LogicalOrTest.php | 2 +- .../Boolean/NotEqualNotIdenticalTest.php | 2 +- .../Boolean/NotIdenticalNotEqualTest.php | 2 +- .../phpunit/Mutator/Boolean/TrueValueTest.php | 2 +- tests/phpunit/Mutator/Boolean/Yield_Test.php | 2 +- tests/phpunit/Mutator/Cast/CastArrayTest.php | 2 +- tests/phpunit/Mutator/Cast/CastBoolTest.php | 2 +- tests/phpunit/Mutator/Cast/CastFloatTest.php | 2 +- tests/phpunit/Mutator/Cast/CastIntTest.php | 2 +- tests/phpunit/Mutator/Cast/CastObjectTest.php | 2 +- tests/phpunit/Mutator/Cast/CastStringTest.php | 2 +- .../GreaterThanOrEqualToTest.php | 2 +- .../ConditionalBoundary/GreaterThanTest.php | 2 +- .../LessThanOrEqualToTest.php | 2 +- .../ConditionalBoundary/LessThanTest.php | 2 +- .../ConditionalNegotiation/EqualTest.php | 2 +- .../GreaterThanNegotiationTest.php | 2 +- .../GreaterThanOrEqualToNegotiationTest.php | 2 +- .../ConditionalNegotiation/IdenticalTest.php | 2 +- .../LessThanNegotiationTest.php | 2 +- .../LessThanOrEqualToNegotiationTest.php | 2 +- .../ConditionalNegotiation/NotEqualTest.php | 2 +- .../NotIdenticalTest.php | 2 +- tests/phpunit/Mutator/DefinitionTest.php | 8 ++--- .../phpunit/Mutator/Extensions/BCMathTest.php | 6 ++-- .../Mutator/Extensions/MBStringTest.php | 4 +-- .../ProtectedVisibilityTest.php | 2 +- .../PublicVisibilityTest.php | 2 +- tests/phpunit/Mutator/IgnoreMutatorTest.php | 3 +- tests/phpunit/Mutator/InvalidMutatorTest.php | 1 + tests/phpunit/Mutator/Loop/DoWhileTest.php | 2 +- tests/phpunit/Mutator/Loop/For_Test.php | 2 +- tests/phpunit/Mutator/Loop/Foreach_Test.php | 2 +- tests/phpunit/Mutator/Loop/While_Test.php | 2 +- tests/phpunit/Mutator/MutatorFactoryTest.php | 11 +++--- .../Mutator/MutatorFixturesProvider.php | 7 ++-- tests/phpunit/Mutator/MutatorResolverTest.php | 9 ++--- .../phpunit/Mutator/MutatorRobustnessTest.php | 11 +++--- tests/phpunit/Mutator/NoopMutatorTest.php | 3 +- .../Mutator/Number/DecrementIntegerTest.php | 6 ++-- .../Mutator/Number/IncrementIntegerTest.php | 6 ++-- .../Mutator/Number/OneZeroFloatTest.php | 2 +- .../Mutator/Operator/AssignCoalesceTest.php | 2 +- tests/phpunit/Mutator/Operator/Break_Test.php | 2 +- tests/phpunit/Mutator/Operator/Catch_Test.php | 2 +- .../phpunit/Mutator/Operator/CoalesceTest.php | 2 +- tests/phpunit/Mutator/Operator/ConcatTest.php | 2 +- .../Mutator/Operator/Continue_Test.php | 2 +- .../Mutator/Operator/ElseIfNegationTest.php | 2 +- .../phpunit/Mutator/Operator/Finally_Test.php | 2 +- .../Mutator/Operator/IfNegationTest.php | 2 +- .../Operator/NullSafeMethodCallTest.php | 4 +-- .../Operator/NullSafePropertyCallTest.php | 4 +-- .../Mutator/Operator/SpreadAssignmentTest.php | 2 +- .../Mutator/Operator/SpreadOneItemTest.php | 2 +- .../Mutator/Operator/SpreadRemovalTest.php | 2 +- .../phpunit/Mutator/Operator/TernaryTest.php | 4 +-- tests/phpunit/Mutator/Operator/Throw_Test.php | 2 +- tests/phpunit/Mutator/ProfileListTest.php | 7 ++-- .../Mutator/Regex/PregMatchMatchesTest.php | 2 +- .../Regex/PregMatchRemoveCaretTest.php | 2 +- .../Regex/PregMatchRemoveDollarTest.php | 2 +- .../Regex/PregMatchRemoveFlagsTest.php | 2 +- tests/phpunit/Mutator/Regex/PregQuoteTest.php | 2 +- .../Mutator/Removal/ArrayItemRemovalTest.php | 2 +- .../Mutator/Removal/CatchBlockRemovalTest.php | 2 +- .../Mutator/Removal/CloneRemovalTest.php | 2 +- .../Removal/ConcatOperandRemovalTest.php | 2 +- .../Removal/FunctionCallRemovalTest.php | 2 +- .../Mutator/Removal/MatchArmRemovalTest.php | 2 +- .../Mutator/Removal/MethodCallRemovalTest.php | 2 +- .../Mutator/Removal/SharedCaseRemovalTest.php | 2 +- .../Mutator/ReturnValue/ArrayOneItemTest.php | 2 +- .../Mutator/ReturnValue/FloatNegationTest.php | 2 +- .../Mutator/ReturnValue/FunctionCallTest.php | 2 +- .../ReturnValue/IntegerNegationTest.php | 2 +- .../Mutator/ReturnValue/NewObjectTest.php | 2 +- .../phpunit/Mutator/ReturnValue/ThisTest.php | 4 +-- .../Mutator/ReturnValue/YieldValueTest.php | 2 +- tests/phpunit/Mutator/Sort/SpaceshipTest.php | 2 +- tests/phpunit/Mutator/SyntaxErrorTest.php | 1 + .../Unwrap/UnwrapArrayChangeKeyCaseTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayChunkTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayColumnTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayCombineTest.php | 2 +- .../Unwrap/UnwrapArrayDiffAssocTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayDiffKeyTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayDiffTest.php | 2 +- .../Unwrap/UnwrapArrayDiffUassocTest.php | 2 +- .../Unwrap/UnwrapArrayDiffUkeyTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayFilterTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayFlipTest.php | 2 +- .../Unwrap/UnwrapArrayIntersectAssocTest.php | 2 +- .../Unwrap/UnwrapArrayIntersectKeyTest.php | 2 +- .../Unwrap/UnwrapArrayIntersectTest.php | 2 +- .../Unwrap/UnwrapArrayIntersectUassocTest.php | 2 +- .../Unwrap/UnwrapArrayIntersectUkeyTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayKeysTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayMapTest.php | 2 +- .../Unwrap/UnwrapArrayMergeRecursiveTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayMergeTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayPadTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayReduceTest.php | 2 +- .../UnwrapArrayReplaceRecursiveTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayReplaceTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayReverseTest.php | 2 +- .../Mutator/Unwrap/UnwrapArraySliceTest.php | 2 +- .../Mutator/Unwrap/UnwrapArraySpliceTest.php | 2 +- .../Unwrap/UnwrapArrayUdiffAssocTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayUdiffTest.php | 2 +- .../Unwrap/UnwrapArrayUdiffUassocTest.php | 2 +- .../Unwrap/UnwrapArrayUintersectAssocTest.php | 2 +- .../Unwrap/UnwrapArrayUintersectTest.php | 2 +- .../UnwrapArrayUintersectUassocTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayUniqueTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayValuesTest.php | 2 +- .../Mutator/Unwrap/UnwrapFinallyTest.php | 2 +- .../Mutator/Unwrap/UnwrapLcFirstTest.php | 2 +- .../Mutator/Unwrap/UnwrapLtrimTest.php | 2 +- .../Mutator/Unwrap/UnwrapRtrimTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrIreplaceTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrRepeatTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrReplaceTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrRevTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrShuffleTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrToLowerTest.php | 2 +- .../Mutator/Unwrap/UnwrapStrToUpperTest.php | 2 +- .../Mutator/Unwrap/UnwrapSubstrTest.php | 2 +- .../phpunit/Mutator/Unwrap/UnwrapTrimTest.php | 2 +- .../Mutator/Unwrap/UnwrapUcFirstTest.php | 2 +- .../Mutator/Unwrap/UnwrapUcWordsTest.php | 2 +- tests/phpunit/MutatorNameTest.php | 2 +- tests/phpunit/PhpParser/FileParserTest.php | 6 ++-- .../PhpParser/Visitor/BaseVisitorTestCase.php | 2 +- .../PhpParser/Visitor/CloneVisitorTest.php | 2 +- .../IgnoreNode/BaseNodeIgnorerTestCase.php | 2 +- .../PhpParser/Visitor/MutatorVisitorTest.php | 6 ++-- .../Factory/MutantProcessFactoryTest.php | 6 ++-- .../Runner/MutationTestingRunnerTest.php | 10 +++--- tests/phpunit/StringNormalizerTest.php | 1 + .../Coverage/LineRangeCalculatorTest.php | 2 +- 210 files changed, 334 insertions(+), 314 deletions(-) rename {tests/phpunit/Mutator => src/Testing}/BaseMutatorTestCase.php (90%) rename {tests/phpunit/Mutator => src/Testing}/MutatorName.php (98%) rename {tests/phpunit/Fixtures => src/Testing}/SimpleMutation.php (96%) rename {tests/phpunit/Fixtures => src/Testing}/SimpleMutationsCollectorVisitor.php (97%) rename {tests/phpunit => src/Testing}/SingletonContainer.php (98%) rename {tests/phpunit/AutoReview => src/Testing}/SourceTestClassNameScheme.php (98%) rename {tests/phpunit => src/Testing}/StringNormalizer.php (98%) diff --git a/composer.lock b/composer.lock index 05b770bb73..c03561add3 100644 --- a/composer.lock +++ b/composer.lock @@ -4806,5 +4806,5 @@ "platform-overrides": { "php": "8.1.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/infection.json5 b/infection.json5 index 110754e09a..d534af4cc3 100644 --- a/infection.json5 +++ b/infection.json5 @@ -35,6 +35,6 @@ ignore: [ "Infection\\Mutator\\Boolean\\LogicalOr::canMutate" ] - } + }, } } diff --git a/src/Console/Application.php b/src/Console/Application.php index e932bd0acb..504a771d3d 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -35,6 +35,7 @@ namespace Infection\Console; +use Infection\Command\CustomMutatorCommand; use function array_merge; use function class_exists; use Composer\InstalledVersions; @@ -104,6 +105,7 @@ protected function getDefaultCommands(): array new ConfigureCommand(), new RunCommand(), new DescribeCommand(), + new CustomMutatorCommand(), ], ); diff --git a/tests/phpunit/Mutator/BaseMutatorTestCase.php b/src/Testing/BaseMutatorTestCase.php similarity index 90% rename from tests/phpunit/Mutator/BaseMutatorTestCase.php rename to src/Testing/BaseMutatorTestCase.php index ff49fd79aa..3bc69871fc 100644 --- a/tests/phpunit/Mutator/BaseMutatorTestCase.php +++ b/src/Testing/BaseMutatorTestCase.php @@ -33,27 +33,25 @@ declare(strict_types=1); -namespace Infection\Tests\Mutator; +namespace Infection\Testing; -use function array_shift; -use function count; -use function escapeshellarg; -use function implode; use Infection\Mutator\Mutator; +use Infection\Mutator\ProfileList; use Infection\PhpParser\NodeTraverserFactory; use Infection\PhpParser\Visitor\CloneVisitor; use Infection\PhpParser\Visitor\MutatorVisitor; -use Infection\Tests\AutoReview\SourceTestClassNameScheme; -use Infection\Tests\Fixtures\SimpleMutation; -use Infection\Tests\Fixtures\SimpleMutationsCollectorVisitor; -use Infection\Tests\SingletonContainer; -use Infection\Tests\StringNormalizer; -use const PHP_EOL; use PhpParser\NodeTraverser; use PHPUnit\Framework\TestCase; +use Webmozart\Assert\Assert; +use function array_flip; +use function array_key_exists; +use function array_shift; +use function count; +use function escapeshellarg; +use function implode; use function Safe\exec; use function sprintf; -use Webmozart\Assert\Assert; +use const PHP_EOL; abstract class BaseMutatorTestCase extends TestCase { @@ -118,17 +116,25 @@ final public function doTest(string $inputCode, $expectedCode = [], array $setti final protected function createMutator(array $settings = []): Mutator { - $mutatorClassName = SourceTestClassNameScheme::getSourceClassName(static::class); + $mutatorClassName = $this->getTestedMutatorClassName(); + + $isBuiltinMutator = array_key_exists($mutatorClassName, array_flip(ProfileList::ALL_MUTATORS)); + $mutatorName = $isBuiltinMutator ? MutatorName::getName($mutatorClassName) : $mutatorClassName; // TODO: this is a bit ridicule... return SingletonContainer::getContainer() ->getMutatorFactory() ->create([ $mutatorClassName => ['settings' => $settings], - ], false)[MutatorName::getName($mutatorClassName)] + ], false)[$mutatorName] ; } + protected function getTestedMutatorClassName(): string + { + return SourceTestClassNameScheme::getSourceClassName(static::class); + } + /** * @return string[] */ @@ -189,7 +195,7 @@ private function assertSyntaxIsValid(string $realMutatedCode): void $returnCode, sprintf( 'Mutator %s produces invalid code', - $this->createMutator()->getName(), + $this->mutator->getName(), ), ); } diff --git a/tests/phpunit/Mutator/MutatorName.php b/src/Testing/MutatorName.php similarity index 98% rename from tests/phpunit/Mutator/MutatorName.php rename to src/Testing/MutatorName.php index 6eaa4aae4d..da70e9517d 100644 --- a/tests/phpunit/Mutator/MutatorName.php +++ b/src/Testing/MutatorName.php @@ -33,12 +33,12 @@ declare(strict_types=1); -namespace Infection\Tests\Mutator; +namespace Infection\Testing; -use function array_flip; use Infection\CannotBeInstantiated; use Infection\Mutator\ProfileList; use Webmozart\Assert\Assert; +use function array_flip; final class MutatorName { diff --git a/tests/phpunit/Fixtures/SimpleMutation.php b/src/Testing/SimpleMutation.php similarity index 96% rename from tests/phpunit/Fixtures/SimpleMutation.php rename to src/Testing/SimpleMutation.php index fb25008837..0aac9c95f2 100644 --- a/tests/phpunit/Fixtures/SimpleMutation.php +++ b/src/Testing/SimpleMutation.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Infection\Tests\Fixtures; +namespace Infection\Testing; use Infection\Mutation\Mutation; use Infection\Mutator\Mutator; diff --git a/tests/phpunit/Fixtures/SimpleMutationsCollectorVisitor.php b/src/Testing/SimpleMutationsCollectorVisitor.php similarity index 97% rename from tests/phpunit/Fixtures/SimpleMutationsCollectorVisitor.php rename to src/Testing/SimpleMutationsCollectorVisitor.php index f2cee37197..08f5d52c1d 100644 --- a/tests/phpunit/Fixtures/SimpleMutationsCollectorVisitor.php +++ b/src/Testing/SimpleMutationsCollectorVisitor.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Infection\Tests\Fixtures; +namespace Infection\Testing; use Infection\Mutator\Mutator; use Infection\PhpParser\MutatedNode; diff --git a/tests/phpunit/SingletonContainer.php b/src/Testing/SingletonContainer.php similarity index 98% rename from tests/phpunit/SingletonContainer.php rename to src/Testing/SingletonContainer.php index 531c3d7482..45772a59fc 100644 --- a/tests/phpunit/SingletonContainer.php +++ b/src/Testing/SingletonContainer.php @@ -33,7 +33,7 @@ declare(strict_types=1); -namespace Infection\Tests; +namespace Infection\Testing; use Infection\Container; use Infection\Tests\AutoReview\PhpDoc\PHPDocParser; diff --git a/tests/phpunit/AutoReview/SourceTestClassNameScheme.php b/src/Testing/SourceTestClassNameScheme.php similarity index 98% rename from tests/phpunit/AutoReview/SourceTestClassNameScheme.php rename to src/Testing/SourceTestClassNameScheme.php index 92aabb4f66..d58bb25e9f 100644 --- a/tests/phpunit/AutoReview/SourceTestClassNameScheme.php +++ b/src/Testing/SourceTestClassNameScheme.php @@ -33,7 +33,7 @@ declare(strict_types=1); -namespace Infection\Tests\AutoReview; +namespace Infection\Testing; use Infection\CannotBeInstantiated; use function Safe\preg_match; diff --git a/tests/phpunit/StringNormalizer.php b/src/Testing/StringNormalizer.php similarity index 98% rename from tests/phpunit/StringNormalizer.php rename to src/Testing/StringNormalizer.php index 5a9ac3ad04..954f1cbf50 100644 --- a/tests/phpunit/StringNormalizer.php +++ b/src/Testing/StringNormalizer.php @@ -33,12 +33,12 @@ declare(strict_types=1); -namespace Infection\Tests; +namespace Infection\Testing; +use Infection\CannotBeInstantiated; use function array_map; use function explode; use function implode; -use Infection\CannotBeInstantiated; final class StringNormalizer { diff --git a/tests/phpunit/AutoReview/ContainerTest.php b/tests/phpunit/AutoReview/ContainerTest.php index 058dd521b4..617f496261 100644 --- a/tests/phpunit/AutoReview/ContainerTest.php +++ b/tests/phpunit/AutoReview/ContainerTest.php @@ -35,18 +35,18 @@ namespace Infection\Tests\AutoReview; -use function array_map; -use function in_array; +use Infection\Testing\SingletonContainer; use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; -use Infection\Tests\SingletonContainer; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProviderExternal; use PHPUnit\Framework\TestCase; use ReflectionClass; +use Symfony\Component\Filesystem\Path; +use function array_map; +use function in_array; use function Safe\file_get_contents; use function sprintf; use function strpos; -use Symfony\Component\Filesystem\Path; #[CoversNothing] final class ContainerTest extends TestCase diff --git a/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php b/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php index be5ba99145..f4703a7835 100644 --- a/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php +++ b/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php @@ -35,18 +35,18 @@ namespace Infection\Tests\AutoReview\EnvVariableManipulation; +use Infection\CannotBeInstantiated; +use Infection\Testing\SourceTestClassNameScheme; +use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; +use PHPUnit\Framework\TestCase; +use ReflectionClass; +use Webmozart\Assert\Assert; use function array_filter; use function array_map; use function array_values; use function class_exists; -use Infection\CannotBeInstantiated; -use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; -use Infection\Tests\AutoReview\SourceTestClassNameScheme; use function iterator_to_array; -use PHPUnit\Framework\TestCase; -use ReflectionClass; use function Safe\file_get_contents; -use Webmozart\Assert\Assert; final class EnvTestCasesProvider { diff --git a/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php b/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php index 1301863b09..3d8ef7520b 100644 --- a/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php +++ b/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php @@ -35,20 +35,20 @@ namespace Infection\Tests\AutoReview\IntegrationGroup; -use function array_filter; -use function array_map; -use function array_values; -use function class_exists; use Infection\CannotBeInstantiated; +use Infection\Testing\SourceTestClassNameScheme; use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; -use Infection\Tests\AutoReview\SourceTestClassNameScheme; use Infection\Tests\Console\E2ETest; use Infection\Tests\FileSystem\FileSystemTestCase; -use function iterator_to_array; use PHPUnit\Framework\TestCase; use ReflectionClass; -use function Safe\file_get_contents; use Webmozart\Assert\Assert; +use function array_filter; +use function array_map; +use function array_values; +use function class_exists; +use function iterator_to_array; +use function Safe\file_get_contents; final class IntegrationGroupProvider { diff --git a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php index 02998130b8..36449e25fd 100644 --- a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php +++ b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php @@ -35,21 +35,21 @@ namespace Infection\Tests\AutoReview\ProjectCode; +use Infection\StreamWrapper\IncludeInterceptor; +use Infection\Testing\SingletonContainer; +use Infection\Testing\SourceTestClassNameScheme; +use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProviderExternal; +use PHPUnit\Framework\TestCase; +use ReflectionClass; +use ReflectionProperty; use function array_filter; use function array_flip; use function array_key_exists; use function array_map; use function class_exists; use function in_array; -use Infection\StreamWrapper\IncludeInterceptor; -use Infection\Tests\AutoReview\SourceTestClassNameScheme; -use Infection\Tests\SingletonContainer; use function is_executable; -use PHPUnit\Framework\Attributes\CoversNothing; -use PHPUnit\Framework\Attributes\DataProviderExternal; -use PHPUnit\Framework\TestCase; -use ReflectionClass; -use ReflectionProperty; use function sprintf; /** diff --git a/tests/phpunit/AutoReview/SourceTestClassNameSchemeTest.php b/tests/phpunit/AutoReview/SourceTestClassNameSchemeTest.php index 4b6d88c5b1..91144429bc 100644 --- a/tests/phpunit/AutoReview/SourceTestClassNameSchemeTest.php +++ b/tests/phpunit/AutoReview/SourceTestClassNameSchemeTest.php @@ -35,6 +35,7 @@ namespace Infection\Tests\AutoReview; +use Infection\Testing\SourceTestClassNameScheme; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/Command/DescribeCommandTest.php b/tests/phpunit/Command/DescribeCommandTest.php index de66aaebca..40ce426251 100644 --- a/tests/phpunit/Command/DescribeCommandTest.php +++ b/tests/phpunit/Command/DescribeCommandTest.php @@ -37,7 +37,7 @@ use Infection\Command\DescribeCommand; use Infection\Console\Application; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Tester\CommandTester; diff --git a/tests/phpunit/Command/RunCommandTest.php b/tests/phpunit/Command/RunCommandTest.php index b646430a2a..47261ba942 100644 --- a/tests/phpunit/Command/RunCommandTest.php +++ b/tests/phpunit/Command/RunCommandTest.php @@ -37,7 +37,7 @@ use Infection\Command\RunCommand; use Infection\Console\Application; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; diff --git a/tests/phpunit/Configuration/ConfigurationFactoryTest.php b/tests/phpunit/Configuration/ConfigurationFactoryTest.php index 5bf4401e4b..c422d9b159 100644 --- a/tests/phpunit/Configuration/ConfigurationFactoryTest.php +++ b/tests/phpunit/Configuration/ConfigurationFactoryTest.php @@ -55,9 +55,8 @@ use Infection\Mutator\NoopMutator; use Infection\Mutator\Removal\MethodCallRemoval; use Infection\TestFramework\MapSourceClassToTestStrategy; +use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\DummyCiDetector; -use function Infection\Tests\normalizePath; -use Infection\Tests\SingletonContainer; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; @@ -65,6 +64,7 @@ use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\ObjectProphecy; use Symfony\Component\Finder\SplFileInfo; +use function Infection\Tests\normalizePath; use function sys_get_temp_dir; #[Group('integration')] diff --git a/tests/phpunit/Console/E2ETest.php b/tests/phpunit/Console/E2ETest.php index 69876473a7..7c9b4239ae 100644 --- a/tests/phpunit/Console/E2ETest.php +++ b/tests/phpunit/Console/E2ETest.php @@ -35,31 +35,32 @@ namespace Infection\Tests\Console; -use function array_merge; -use function basename; use Composer\Autoload\ClassLoader; -use const DIRECTORY_SEPARATOR; -use function extension_loaded; -use function file_exists; -use function function_exists; -use function getenv; -use function implode; use Infection\Command\ConfigureCommand; use Infection\Console\Application; use Infection\Console\E2E; use Infection\FileSystem\Finder\ComposerExecutableFinder; use Infection\FileSystem\Finder\Exception\FinderException; -use Infection\Tests\SingletonContainer; -use function is_readable; -use const PHP_EOL; -use const PHP_OS; -use const PHP_SAPI; +use Infection\Testing\SingletonContainer; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Large; use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Process; +use function array_merge; +use function basename; +use function extension_loaded; +use function file_exists; +use function function_exists; +use function getenv; +use function implode; +use function is_readable; use function Safe\chdir; use function Safe\copy; use function Safe\file_get_contents; @@ -69,11 +70,10 @@ use function str_contains; use function str_replace; use function str_starts_with; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Output\BufferedOutput; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Process; +use const DIRECTORY_SEPARATOR; +use const PHP_EOL; +use const PHP_OS; +use const PHP_SAPI; #[Group('e2e')] #[Group('integration')] diff --git a/tests/phpunit/ContainerTest.php b/tests/phpunit/ContainerTest.php index 4e320fe564..a4f9d32175 100644 --- a/tests/phpunit/ContainerTest.php +++ b/tests/phpunit/ContainerTest.php @@ -37,6 +37,7 @@ use Infection\Container; use Infection\FileSystem\Locator\FileNotFound; +use Infection\Testing\SingletonContainer; use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; diff --git a/tests/phpunit/Logger/CreateMetricsCalculator.php b/tests/phpunit/Logger/CreateMetricsCalculator.php index 2e7521c214..965e4a539b 100644 --- a/tests/phpunit/Logger/CreateMetricsCalculator.php +++ b/tests/phpunit/Logger/CreateMetricsCalculator.php @@ -42,7 +42,7 @@ use Infection\Mutant\MutantExecutionResult; use Infection\Mutator\Loop\For_; use Infection\Mutator\Regex\PregQuote; -use Infection\Tests\Mutator\MutatorName; +use Infection\Testing\MutatorName; use function Infection\Tests\normalize_trailing_spaces; use function Later\now; diff --git a/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php b/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php index 5343f0c10a..0648d65e38 100644 --- a/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php +++ b/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php @@ -35,8 +35,6 @@ namespace Infection\Tests\Logger\Html; -use function array_map; -use function implode; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Logger\Html\StrykerHtmlReportBuilder; use Infection\Metrics\Collector; @@ -47,21 +45,23 @@ use Infection\Mutator\FunctionSignature\PublicVisibility; use Infection\Mutator\Removal\ArrayItemRemoval; use Infection\Mutator\Removal\MethodCallRemoval; -use Infection\Tests\Mutator\MutatorName; -use function Infection\Tests\normalize_trailing_spaces; +use Infection\Testing\MutatorName; use JsonSchema\Validator; -use function Later\now; -use const PHP_EOL; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; +use function array_map; +use function implode; +use function Infection\Tests\normalize_trailing_spaces; +use function Later\now; use function Safe\base64_decode; use function Safe\file_get_contents; use function Safe\json_decode; use function Safe\json_encode; use function Safe\realpath; use function sprintf; +use const PHP_EOL; #[Group('integration')] #[CoversClass(StrykerHtmlReportBuilder::class)] diff --git a/tests/phpunit/Metrics/CreateMutantExecutionResult.php b/tests/phpunit/Metrics/CreateMutantExecutionResult.php index bad452df4d..8300e266a2 100644 --- a/tests/phpunit/Metrics/CreateMutantExecutionResult.php +++ b/tests/phpunit/Metrics/CreateMutantExecutionResult.php @@ -38,10 +38,10 @@ use Infection\Metrics\Collector; use Infection\Mutant\MutantExecutionResult; use Infection\Mutator\Loop\For_; -use Infection\Tests\Mutator\MutatorName; +use Infection\Testing\MutatorName; use function Later\now; -use const PHP_EOL; use function str_replace; +use const PHP_EOL; trait CreateMutantExecutionResult { diff --git a/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php b/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php index fcae4218f5..8b607cd6fd 100644 --- a/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php +++ b/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php @@ -39,11 +39,11 @@ use Infection\Mutant\DetectionStatus; use Infection\Mutant\MutantExecutionResult; use Infection\Mutator\Loop\For_; -use Infection\Tests\Mutator\MutatorName; -use function Later\now; +use Infection\Testing\MutatorName; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use function Later\now; #[CoversClass(SortableMutantExecutionResults::class)] final class SortableMutantExecutionResultsTest extends TestCase diff --git a/tests/phpunit/Mutant/MutantCodeFactoryTest.php b/tests/phpunit/Mutant/MutantCodeFactoryTest.php index 000474b0f9..1d04014b71 100644 --- a/tests/phpunit/Mutant/MutantCodeFactoryTest.php +++ b/tests/phpunit/Mutant/MutantCodeFactoryTest.php @@ -39,8 +39,8 @@ use Infection\Mutation\Mutation; use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; -use Infection\Tests\Mutator\MutatorName; -use Infection\Tests\SingletonContainer; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutant/MutantExecutionResultFactoryTest.php b/tests/phpunit/Mutant/MutantExecutionResultFactoryTest.php index c61bfd4313..3b792017ce 100644 --- a/tests/phpunit/Mutant/MutantExecutionResultFactoryTest.php +++ b/tests/phpunit/Mutant/MutantExecutionResultFactoryTest.php @@ -43,7 +43,7 @@ use Infection\Mutator\Loop\For_; use Infection\PhpParser\MutatedNode; use Infection\Process\MutantProcess; -use Infection\Tests\Mutator\MutatorName; +use Infection\Testing\MutatorName; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/phpunit/Mutant/MutantExecutionResultTest.php b/tests/phpunit/Mutant/MutantExecutionResultTest.php index bd34ebc0c1..d1ea5194d0 100644 --- a/tests/phpunit/Mutant/MutantExecutionResultTest.php +++ b/tests/phpunit/Mutant/MutantExecutionResultTest.php @@ -41,11 +41,11 @@ use Infection\Mutation\Mutation; use Infection\Mutator\Loop\For_; use Infection\PhpParser\MutatedNode; -use Infection\Tests\Mutator\MutatorName; -use function Later\now; +use Infection\Testing\MutatorName; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; +use function Later\now; #[CoversClass(MutantExecutionResult::class)] final class MutantExecutionResultTest extends TestCase diff --git a/tests/phpunit/Mutant/MutantFactoryTest.php b/tests/phpunit/Mutant/MutantFactoryTest.php index ffa697548d..b8d18950b2 100644 --- a/tests/phpunit/Mutant/MutantFactoryTest.php +++ b/tests/phpunit/Mutant/MutantFactoryTest.php @@ -42,7 +42,7 @@ use Infection\Mutation\Mutation; use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; -use Infection\Tests\Mutator\MutatorName; +use Infection\Testing\MutatorName; use PhpParser\Node; use PhpParser\PrettyPrinterAbstract; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/tests/phpunit/Mutant/MutantTest.php b/tests/phpunit/Mutant/MutantTest.php index bf132f7253..e12824e377 100644 --- a/tests/phpunit/Mutant/MutantTest.php +++ b/tests/phpunit/Mutant/MutantTest.php @@ -40,12 +40,12 @@ use Infection\Mutation\Mutation; use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; -use Infection\Tests\Mutator\MutatorName; -use function Later\now; +use Infection\Testing\MutatorName; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use function Later\now; #[CoversClass(Mutant::class)] final class MutantTest extends TestCase diff --git a/tests/phpunit/Mutation/FileMutationGeneratorTest.php b/tests/phpunit/Mutation/FileMutationGeneratorTest.php index 0f55f43dcb..51cd0ef459 100644 --- a/tests/phpunit/Mutation/FileMutationGeneratorTest.php +++ b/tests/phpunit/Mutation/FileMutationGeneratorTest.php @@ -35,7 +35,6 @@ namespace Infection\Tests\Mutation; -use function current; use Infection\Differ\FilesDiffChangedLines; use Infection\Mutation\FileMutationGenerator; use Infection\Mutation\Mutation; @@ -47,18 +46,19 @@ use Infection\PhpParser\Visitor\MutationCollectorVisitor; use Infection\TestFramework\Coverage\LineRangeCalculator; use Infection\TestFramework\Coverage\Trace; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\PhpParser\FakeIgnorer; use Infection\Tests\Fixtures\PhpParser\FakeNode; -use Infection\Tests\Mutator\MutatorName; -use Infection\Tests\SingletonContainer; -use function iterator_to_array; use PhpParser\NodeTraverserInterface; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use function sprintf; use Symfony\Component\Finder\SplFileInfo; +use function current; +use function iterator_to_array; +use function sprintf; #[CoversClass(FileMutationGenerator::class)] final class FileMutationGeneratorTest extends TestCase diff --git a/tests/phpunit/Mutation/MutationTest.php b/tests/phpunit/Mutation/MutationTest.php index 8ea7bd689e..470e23b325 100644 --- a/tests/phpunit/Mutation/MutationTest.php +++ b/tests/phpunit/Mutation/MutationTest.php @@ -35,17 +35,17 @@ namespace Infection\Tests\Mutation; -use function array_merge; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Mutation\Mutation; use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; -use Infection\Tests\Mutator\MutatorName; -use function md5; +use Infection\Testing\MutatorName; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use function array_merge; +use function md5; #[CoversClass(Mutation::class)] final class MutationTest extends TestCase diff --git a/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php b/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php index 3c1a5af0c0..aee74901f6 100644 --- a/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\AssignmentEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php b/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php index 6fc4807d26..94f7fde654 100644 --- a/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php +++ b/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Assignment; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php index 009ec8abb6..ece328c4d9 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\BitwiseAnd; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php index 9151bed729..df256195f2 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\BitwiseNot; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php index 228975bead..68d53d4b90 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\BitwiseOr; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php index 0e346e2ad8..83ae63a3ba 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\BitwiseXor; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/DecrementTest.php b/tests/phpunit/Mutator/Arithmetic/DecrementTest.php index 4c9cd3ef2c..3ae82b3b5e 100644 --- a/tests/phpunit/Mutator/Arithmetic/DecrementTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DecrementTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Decrement; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php b/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php index 7f35ed0a92..b087b68968 100644 --- a/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\DivEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/DivisionTest.php b/tests/phpunit/Mutator/Arithmetic/DivisionTest.php index d482f562d3..7f79841636 100644 --- a/tests/phpunit/Mutator/Arithmetic/DivisionTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DivisionTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Division; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php b/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php index 178d9d632b..60b918982c 100644 --- a/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Exponentiation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/IncrementTest.php b/tests/phpunit/Mutator/Arithmetic/IncrementTest.php index e540b1620f..7edd6e9a6f 100644 --- a/tests/phpunit/Mutator/Arithmetic/IncrementTest.php +++ b/tests/phpunit/Mutator/Arithmetic/IncrementTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Increment; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php b/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php index b6f74fb502..6c1eb79890 100644 --- a/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\MinusEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/MinusTest.php b/tests/phpunit/Mutator/Arithmetic/MinusTest.php index f470a515fa..ed0929cb6e 100644 --- a/tests/phpunit/Mutator/Arithmetic/MinusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MinusTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Minus; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php b/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php index 9b0c7a2641..7f072e0ac7 100644 --- a/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\ModEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/ModulusTest.php b/tests/phpunit/Mutator/Arithmetic/ModulusTest.php index 227c0763d8..f6f5de6ddb 100644 --- a/tests/phpunit/Mutator/Arithmetic/ModulusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ModulusTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Modulus; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php b/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php index 88a16d9091..99aefa4b59 100644 --- a/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\MulEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php b/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php index adef66a22a..d5e75654c5 100644 --- a/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Multiplication; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php b/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php index e243a1d37d..ee394aacf3 100644 --- a/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\PlusEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/PlusTest.php b/tests/phpunit/Mutator/Arithmetic/PlusTest.php index 3a1ebbf82f..2b79391178 100644 --- a/tests/phpunit/Mutator/Arithmetic/PlusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PlusTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\Plus; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PhpParser\Node; use PhpParser\Node\Expr\Array_; use PhpParser\Node\Scalar\LNumber; diff --git a/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php b/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php index 8aed8a7c5c..b10283ff9f 100644 --- a/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\PowEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php b/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php index 62a958b2a9..99eaa74b02 100644 --- a/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php +++ b/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\RoundingFamily; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php b/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php index 4a5f7156d9..302031a43e 100644 --- a/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\ShiftLeft; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php b/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php index 3c7cf5cb2d..be973d7e95 100644 --- a/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Arithmetic; use Infection\Mutator\Arithmetic\ShiftRight; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/ArrayItemTest.php b/tests/phpunit/Mutator/Boolean/ArrayItemTest.php index 99d6cd08dd..418939ee90 100644 --- a/tests/phpunit/Mutator/Boolean/ArrayItemTest.php +++ b/tests/phpunit/Mutator/Boolean/ArrayItemTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\ArrayItem; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php b/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php index 258151a42c..1c796f8417 100644 --- a/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php +++ b/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\EqualIdentical; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/FalseValueTest.php b/tests/phpunit/Mutator/Boolean/FalseValueTest.php index d0cb82ec2d..51169caa3f 100644 --- a/tests/phpunit/Mutator/Boolean/FalseValueTest.php +++ b/tests/phpunit/Mutator/Boolean/FalseValueTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\FalseValue; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Name; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php b/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php index 6933c2bb76..892f1d9a64 100644 --- a/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php +++ b/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\IdenticalEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php b/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php index 39b1c4db40..2947e47914 100644 --- a/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php +++ b/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\InstanceOf_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php index 70f0bc7369..d94b94c248 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalAndAllSubExprNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php index 36195e9254..d6f59c6704 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalAndNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php index 6a1b97dc77..9ddc94af87 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalAndSingleSubExprNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndTest.php index 72d3b6bcc3..40e3e9397e 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalAnd; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php b/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php index bdb2e3361d..d9ed19bdb6 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalLowerAnd; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php b/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php index 56e8a29b31..58b0f32b92 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalLowerOr; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalNotTest.php b/tests/phpunit/Mutator/Boolean/LogicalNotTest.php index 043805af14..ae84566a0b 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalNotTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalNotTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalNot; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PhpParser\Node\Expr\BooleanNot; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Name; diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php index 927c4d95a5..5c6b35884d 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalOrAllSubExprNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php index ef00b65330..cbc9cf913a 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalOrNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php index dfa3acc406..9672ce415a 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalOrSingleSubExprNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrTest.php index 2a23cdbe6b..92ca2ed646 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\LogicalOr; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php b/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php index 7d761012b7..b120b270b9 100644 --- a/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php +++ b/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\NotEqualNotIdentical; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php b/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php index 86d0bcfe95..bc6d337a90 100644 --- a/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php +++ b/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\NotIdenticalNotEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Boolean/TrueValueTest.php b/tests/phpunit/Mutator/Boolean/TrueValueTest.php index 2271ce963a..20ebe5f031 100644 --- a/tests/phpunit/Mutator/Boolean/TrueValueTest.php +++ b/tests/phpunit/Mutator/Boolean/TrueValueTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\TrueValue; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Name; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/tests/phpunit/Mutator/Boolean/Yield_Test.php b/tests/phpunit/Mutator/Boolean/Yield_Test.php index 69bff5f532..140736ab3c 100644 --- a/tests/phpunit/Mutator/Boolean/Yield_Test.php +++ b/tests/phpunit/Mutator/Boolean/Yield_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Boolean; use Infection\Mutator\Boolean\Yield_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastArrayTest.php b/tests/phpunit/Mutator/Cast/CastArrayTest.php index cc78ff8786..d3578694e6 100644 --- a/tests/phpunit/Mutator/Cast/CastArrayTest.php +++ b/tests/phpunit/Mutator/Cast/CastArrayTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastArray; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastBoolTest.php b/tests/phpunit/Mutator/Cast/CastBoolTest.php index c7ab0ebe1b..6724993e4f 100644 --- a/tests/phpunit/Mutator/Cast/CastBoolTest.php +++ b/tests/phpunit/Mutator/Cast/CastBoolTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastBool; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastFloatTest.php b/tests/phpunit/Mutator/Cast/CastFloatTest.php index 1013cfc8bb..1906d59b61 100644 --- a/tests/phpunit/Mutator/Cast/CastFloatTest.php +++ b/tests/phpunit/Mutator/Cast/CastFloatTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastFloat; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastIntTest.php b/tests/phpunit/Mutator/Cast/CastIntTest.php index 21db4acb50..257c0893f1 100644 --- a/tests/phpunit/Mutator/Cast/CastIntTest.php +++ b/tests/phpunit/Mutator/Cast/CastIntTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastInt; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastObjectTest.php b/tests/phpunit/Mutator/Cast/CastObjectTest.php index b6dcfa2684..1fbd0b4d09 100644 --- a/tests/phpunit/Mutator/Cast/CastObjectTest.php +++ b/tests/phpunit/Mutator/Cast/CastObjectTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastObject; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Cast/CastStringTest.php b/tests/phpunit/Mutator/Cast/CastStringTest.php index 357542104e..5b89a97415 100644 --- a/tests/phpunit/Mutator/Cast/CastStringTest.php +++ b/tests/phpunit/Mutator/Cast/CastStringTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Cast; use Infection\Mutator\Cast\CastString; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php index 9161b50088..3a739ef020 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalBoundary; use Infection\Mutator\ConditionalBoundary\GreaterThanOrEqualTo; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php index e69b95bd67..ef216d959d 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalBoundary; use Infection\Mutator\ConditionalBoundary\GreaterThan; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php b/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php index be8d9bebdb..5f73ea79a2 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalBoundary; use Infection\Mutator\ConditionalBoundary\LessThanOrEqualTo; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php b/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php index 9bc92bf675..95ab1d852a 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalBoundary; use Infection\Mutator\ConditionalBoundary\LessThan; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php index 736891eec5..d2fd6625d5 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\Equal; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php index b3c907e466..b6cb00e3e2 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\GreaterThanNegotiation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php index 328f90c704..234958a00f 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\GreaterThanOrEqualToNegotiation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php index 95ad01cbf6..de9b29a001 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\Identical; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php index 68dbccc37d..59ef525b38 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\LessThanNegotiation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php index a071010417..dd2412bb19 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\LessThanOrEqualToNegotiation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php index 4967aba688..36baa5d3c6 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\NotEqual; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php index 1e45db8ee0..4915983336 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ConditionalNegotiation; use Infection\Mutator\ConditionalNegotiation\NotIdentical; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/DefinitionTest.php b/tests/phpunit/Mutator/DefinitionTest.php index aff3b901ec..6d2d97f117 100644 --- a/tests/phpunit/Mutator/DefinitionTest.php +++ b/tests/phpunit/Mutator/DefinitionTest.php @@ -35,17 +35,17 @@ namespace Infection\Tests\Mutator; -use function array_diff_key; -use function array_fill_keys; -use function array_flip; use Infection\Mutator\Definition; use Infection\Mutator\Mutator; use Infection\Mutator\MutatorCategory; use Infection\Mutator\ProfileList; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use function array_diff_key; +use function array_fill_keys; +use function array_flip; use function sprintf; #[CoversClass(Definition::class)] diff --git a/tests/phpunit/Mutator/Extensions/BCMathTest.php b/tests/phpunit/Mutator/Extensions/BCMathTest.php index 6a2e44aac2..edbf86e7b7 100644 --- a/tests/phpunit/Mutator/Extensions/BCMathTest.php +++ b/tests/phpunit/Mutator/Extensions/BCMathTest.php @@ -35,12 +35,12 @@ namespace Infection\Tests\Mutator\Extensions; -use function array_map; -use function implode; use Infection\Mutator\Extensions\BCMath; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use function array_map; +use function implode; use function range; use function strtoupper; use function ucfirst; diff --git a/tests/phpunit/Mutator/Extensions/MBStringTest.php b/tests/phpunit/Mutator/Extensions/MBStringTest.php index d2f4ed3e96..408a616841 100644 --- a/tests/phpunit/Mutator/Extensions/MBStringTest.php +++ b/tests/phpunit/Mutator/Extensions/MBStringTest.php @@ -35,11 +35,11 @@ namespace Infection\Tests\Mutator\Extensions; -use function defined; use Infection\Mutator\Extensions\MBString; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use function defined; use function Safe\define; #[CoversClass(MBString::class)] diff --git a/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php b/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php index b5f3ca78ae..5a7d530079 100644 --- a/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php +++ b/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\FunctionSignature; use Infection\Mutator\FunctionSignature\ProtectedVisibility; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php b/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php index 007767c646..3ceeb47173 100644 --- a/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php +++ b/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\FunctionSignature; use Infection\Mutator\FunctionSignature\PublicVisibility; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/IgnoreMutatorTest.php b/tests/phpunit/Mutator/IgnoreMutatorTest.php index 2bd350c76d..11d56df1b0 100644 --- a/tests/phpunit/Mutator/IgnoreMutatorTest.php +++ b/tests/phpunit/Mutator/IgnoreMutatorTest.php @@ -42,12 +42,13 @@ use Infection\Mutator\Mutator; use Infection\PhpParser\Visitor\ReflectionVisitor; use Infection\Reflection\CoreClassReflection; +use Infection\Testing\MutatorName; use Infection\Tests\WithConsecutive; -use function iterator_to_array; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use function iterator_to_array; #[CoversClass(IgnoreMutator::class)] final class IgnoreMutatorTest extends TestCase diff --git a/tests/phpunit/Mutator/InvalidMutatorTest.php b/tests/phpunit/Mutator/InvalidMutatorTest.php index 96988cfc07..73b5a24cf9 100644 --- a/tests/phpunit/Mutator/InvalidMutatorTest.php +++ b/tests/phpunit/Mutator/InvalidMutatorTest.php @@ -38,6 +38,7 @@ use Error; use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\InvalidMutator; +use Infection\Testing\MutatorName; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/Mutator/Loop/DoWhileTest.php b/tests/phpunit/Mutator/Loop/DoWhileTest.php index 6d1c347ae5..e8aa75116e 100644 --- a/tests/phpunit/Mutator/Loop/DoWhileTest.php +++ b/tests/phpunit/Mutator/Loop/DoWhileTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Loop; use Infection\Mutator\Loop\DoWhile; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Loop/For_Test.php b/tests/phpunit/Mutator/Loop/For_Test.php index 3714d8c900..d102a2f2dd 100644 --- a/tests/phpunit/Mutator/Loop/For_Test.php +++ b/tests/phpunit/Mutator/Loop/For_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Loop; use Infection\Mutator\Loop\For_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Loop/Foreach_Test.php b/tests/phpunit/Mutator/Loop/Foreach_Test.php index 29afe354e1..ac6954b563 100644 --- a/tests/phpunit/Mutator/Loop/Foreach_Test.php +++ b/tests/phpunit/Mutator/Loop/Foreach_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Loop; use Infection\Mutator\Loop\Foreach_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Loop/While_Test.php b/tests/phpunit/Mutator/Loop/While_Test.php index bf9a2e9856..a09b39fd01 100644 --- a/tests/phpunit/Mutator/Loop/While_Test.php +++ b/tests/phpunit/Mutator/Loop/While_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Loop; use Infection\Mutator\Loop\While_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/MutatorFactoryTest.php b/tests/phpunit/Mutator/MutatorFactoryTest.php index 22a94132a6..6961b7dfcd 100644 --- a/tests/phpunit/Mutator/MutatorFactoryTest.php +++ b/tests/phpunit/Mutator/MutatorFactoryTest.php @@ -35,9 +35,6 @@ namespace Infection\Tests\Mutator; -use function array_fill_keys; -use function array_values; -use function count; use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\Boolean\TrueValue; use Infection\Mutator\IgnoreMutator; @@ -47,15 +44,19 @@ use Infection\Mutator\Sort\Spaceship; use Infection\PhpParser\Visitor\ReflectionVisitor; use Infection\Reflection\ClassReflection; -use Infection\Tests\SingletonContainer; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; use InvalidArgumentException; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionClass; -use function sprintf; use stdClass; +use function array_fill_keys; +use function array_values; +use function count; +use function sprintf; #[CoversClass(MutatorFactory::class)] final class MutatorFactoryTest extends TestCase diff --git a/tests/phpunit/Mutator/MutatorFixturesProvider.php b/tests/phpunit/Mutator/MutatorFixturesProvider.php index 151d3d337e..6d99a5cb70 100644 --- a/tests/phpunit/Mutator/MutatorFixturesProvider.php +++ b/tests/phpunit/Mutator/MutatorFixturesProvider.php @@ -35,15 +35,16 @@ namespace Infection\Tests\Mutator; +use Infection\CannotBeInstantiated; +use Infection\Testing\BaseMutatorTestCase; +use Symfony\Component\Filesystem\Path; +use Webmozart\Assert\Assert; use function array_key_exists; use function end; use function explode; -use Infection\CannotBeInstantiated; use function Safe\file_get_contents; use function sprintf; use function substr; -use Symfony\Component\Filesystem\Path; -use Webmozart\Assert\Assert; final class MutatorFixturesProvider { diff --git a/tests/phpunit/Mutator/MutatorResolverTest.php b/tests/phpunit/Mutator/MutatorResolverTest.php index 89392130c0..3dd9ee4775 100644 --- a/tests/phpunit/Mutator/MutatorResolverTest.php +++ b/tests/phpunit/Mutator/MutatorResolverTest.php @@ -35,9 +35,6 @@ namespace Infection\Tests\Mutator; -use function array_diff; -use function array_values; -use function count; use Infection\Mutator\Arithmetic\Minus; use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\Boolean\IdenticalEqual; @@ -50,10 +47,14 @@ use Infection\Mutator\Number\IncrementInteger; use Infection\Mutator\Number\OneZeroFloat; use Infection\Mutator\ProfileList; -use Infection\Tests\SingletonContainer; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; +use function array_diff; +use function array_values; +use function count; use function sprintf; #[CoversClass(MutatorResolver::class)] diff --git a/tests/phpunit/Mutator/MutatorRobustnessTest.php b/tests/phpunit/Mutator/MutatorRobustnessTest.php index 21faec2985..913588fea5 100644 --- a/tests/phpunit/Mutator/MutatorRobustnessTest.php +++ b/tests/phpunit/Mutator/MutatorRobustnessTest.php @@ -35,21 +35,22 @@ namespace Infection\Tests\Mutator; -use function array_values; use Infection\Mutator\Mutator; use Infection\Mutator\ProfileList; use Infection\PhpParser\NodeTraverserFactory; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\NullMutationVisitor; -use Infection\Tests\SingletonContainer; -use function ksort; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use const SORT_STRING; -use function sprintf; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; use Throwable; +use function array_values; +use function ksort; +use function sprintf; +use const SORT_STRING; #[CoversNothing] final class MutatorRobustnessTest extends TestCase diff --git a/tests/phpunit/Mutator/NoopMutatorTest.php b/tests/phpunit/Mutator/NoopMutatorTest.php index 40071fed94..3d1c675784 100644 --- a/tests/phpunit/Mutator/NoopMutatorTest.php +++ b/tests/phpunit/Mutator/NoopMutatorTest.php @@ -39,11 +39,12 @@ use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\Mutator; use Infection\Mutator\NoopMutator; -use function iterator_to_array; +use Infection\Testing\MutatorName; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use function iterator_to_array; #[CoversClass(NoopMutator::class)] final class NoopMutatorTest extends TestCase diff --git a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php index a5b6fe035e..c64d54379f 100644 --- a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php @@ -36,11 +36,11 @@ namespace Infection\Tests\Mutator\Number; use Infection\Mutator\Number\DecrementInteger; -use Infection\Tests\Mutator\BaseMutatorTestCase; -use const PHP_INT_MAX; -use const PHP_INT_MIN; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use const PHP_INT_MAX; +use const PHP_INT_MIN; #[CoversClass(DecrementInteger::class)] final class DecrementIntegerTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php index b10bea5c6b..85cdeae644 100644 --- a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php @@ -36,11 +36,11 @@ namespace Infection\Tests\Mutator\Number; use Infection\Mutator\Number\IncrementInteger; -use Infection\Tests\Mutator\BaseMutatorTestCase; -use const PHP_INT_MAX; -use const PHP_INT_MIN; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use const PHP_INT_MAX; +use const PHP_INT_MIN; #[CoversClass(IncrementInteger::class)] final class IncrementIntegerTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Number/OneZeroFloatTest.php b/tests/phpunit/Mutator/Number/OneZeroFloatTest.php index 2410a7de51..623d961c48 100644 --- a/tests/phpunit/Mutator/Number/OneZeroFloatTest.php +++ b/tests/phpunit/Mutator/Number/OneZeroFloatTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Number; use Infection\Mutator\Number\OneZeroFloat; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php b/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php index 969c23a487..96e35b72d4 100644 --- a/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php +++ b/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\AssignCoalesce; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/Break_Test.php b/tests/phpunit/Mutator/Operator/Break_Test.php index c30302029d..38f09c8d54 100644 --- a/tests/phpunit/Mutator/Operator/Break_Test.php +++ b/tests/phpunit/Mutator/Operator/Break_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Break_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/Catch_Test.php b/tests/phpunit/Mutator/Operator/Catch_Test.php index a5153f2d4f..91cbb533c8 100644 --- a/tests/phpunit/Mutator/Operator/Catch_Test.php +++ b/tests/phpunit/Mutator/Operator/Catch_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Catch_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/CoalesceTest.php b/tests/phpunit/Mutator/Operator/CoalesceTest.php index 54de123fcd..28573a128d 100644 --- a/tests/phpunit/Mutator/Operator/CoalesceTest.php +++ b/tests/phpunit/Mutator/Operator/CoalesceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Coalesce; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/ConcatTest.php b/tests/phpunit/Mutator/Operator/ConcatTest.php index b8d6d77337..bf1f759db6 100644 --- a/tests/phpunit/Mutator/Operator/ConcatTest.php +++ b/tests/phpunit/Mutator/Operator/ConcatTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Concat; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/Continue_Test.php b/tests/phpunit/Mutator/Operator/Continue_Test.php index 563bab37d5..2c61c9b004 100644 --- a/tests/phpunit/Mutator/Operator/Continue_Test.php +++ b/tests/phpunit/Mutator/Operator/Continue_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Continue_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php b/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php index b48cd48858..61ea6eecfa 100644 --- a/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php +++ b/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\ElseIfNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/Finally_Test.php b/tests/phpunit/Mutator/Operator/Finally_Test.php index 703178ae9b..0bff1045ad 100644 --- a/tests/phpunit/Mutator/Operator/Finally_Test.php +++ b/tests/phpunit/Mutator/Operator/Finally_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Finally_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/IfNegationTest.php b/tests/phpunit/Mutator/Operator/IfNegationTest.php index b4ebbf5907..12e84cab23 100644 --- a/tests/phpunit/Mutator/Operator/IfNegationTest.php +++ b/tests/phpunit/Mutator/Operator/IfNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\IfNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php index 0af28e5216..bf06d58575 100644 --- a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php @@ -36,10 +36,10 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\NullSafeMethodCall; -use Infection\Tests\Mutator\BaseMutatorTestCase; -use const PHP_VERSION_ID; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use const PHP_VERSION_ID; #[CoversClass(NullSafeMethodCall::class)] final class NullSafeMethodCallTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php index 7af374eae1..ab65e5fbda 100644 --- a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php @@ -36,10 +36,10 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\NullSafePropertyCall; -use Infection\Tests\Mutator\BaseMutatorTestCase; -use const PHP_VERSION_ID; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use const PHP_VERSION_ID; #[CoversClass(NullSafePropertyCall::class)] final class NullSafePropertyCallTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php b/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php index 094d8a2f63..cf6f793595 100644 --- a/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\SpreadAssignment; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php b/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php index b310d466a7..0f34a68f1d 100644 --- a/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\SpreadOneItem; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php b/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php index fd90555762..2a83c13777 100644 --- a/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\SpreadRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Operator/TernaryTest.php b/tests/phpunit/Mutator/Operator/TernaryTest.php index 7c5fed2713..f85f10c4eb 100644 --- a/tests/phpunit/Mutator/Operator/TernaryTest.php +++ b/tests/phpunit/Mutator/Operator/TernaryTest.php @@ -36,10 +36,10 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Ternary; -use Infection\Tests\Mutator\BaseMutatorTestCase; -use const PHP_VERSION_ID; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use const PHP_VERSION_ID; #[CoversClass(Ternary::class)] final class TernaryTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/Throw_Test.php b/tests/phpunit/Mutator/Operator/Throw_Test.php index 47e5308777..d97d7c82ee 100644 --- a/tests/phpunit/Mutator/Operator/Throw_Test.php +++ b/tests/phpunit/Mutator/Operator/Throw_Test.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Operator; use Infection\Mutator\Operator\Throw_; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ProfileListTest.php b/tests/phpunit/Mutator/ProfileListTest.php index 5d51b85afb..450361510a 100644 --- a/tests/phpunit/Mutator/ProfileListTest.php +++ b/tests/phpunit/Mutator/ProfileListTest.php @@ -35,15 +35,16 @@ namespace Infection\Tests\Mutator; -use function array_keys; -use function in_array; use Infection\Mutator\ProfileList; +use Infection\Testing\MutatorName; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProviderExternal; use PHPUnit\Framework\TestCase; +use function array_keys; +use function in_array; use function Safe\sort; -use const SORT_STRING; use function sprintf; +use const SORT_STRING; #[CoversClass(ProfileList::class)] final class ProfileListTest extends TestCase diff --git a/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php b/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php index 513b4d3b11..47ce72a565 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Regex; use Infection\Mutator\Regex\PregMatchMatches; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php index ffb940625a..f571362049 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php @@ -37,7 +37,7 @@ use Generator; use Infection\Mutator\Regex\PregMatchRemoveCaret; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php index 63939df868..21697b77fb 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php @@ -37,7 +37,7 @@ use Generator; use Infection\Mutator\Regex\PregMatchRemoveDollar; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php index 25ce970f2f..40328075ac 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php @@ -37,7 +37,7 @@ use Generator; use Infection\Mutator\Regex\PregMatchRemoveFlags; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Regex/PregQuoteTest.php b/tests/phpunit/Mutator/Regex/PregQuoteTest.php index 736129a9ed..3cd28422a1 100644 --- a/tests/phpunit/Mutator/Regex/PregQuoteTest.php +++ b/tests/phpunit/Mutator/Regex/PregQuoteTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Regex; use Infection\Mutator\Regex\PregQuote; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php b/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php index 7b7cc63155..5bea76ca23 100644 --- a/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\ArrayItemRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php b/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php index 36ebfa0eba..13fd2a532f 100644 --- a/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\CatchBlockRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/CloneRemovalTest.php b/tests/phpunit/Mutator/Removal/CloneRemovalTest.php index 3e07b68c2d..bc2514b99e 100644 --- a/tests/phpunit/Mutator/Removal/CloneRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/CloneRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\CloneRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php b/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php index 73eda7f8ac..03370d3659 100644 --- a/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\ConcatOperandRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php b/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php index b1dfad00c7..fb6f0d1abf 100644 --- a/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\FunctionCallRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php b/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php index bb307e6059..5eeb3757bf 100644 --- a/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\MatchArmRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php b/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php index 69dd56ac0c..83a9c4b84e 100644 --- a/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\MethodCallRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php b/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php index e831d5d73e..da8987d9a7 100644 --- a/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Removal; use Infection\Mutator\Removal\SharedCaseRemoval; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php b/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php index 8427d0e22f..2abd79db4d 100644 --- a/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php +++ b/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\ArrayOneItem; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php b/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php index 08c8fa9ea1..20c9850969 100644 --- a/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php +++ b/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\FloatNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php b/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php index 32a4e587df..294269b69a 100644 --- a/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php +++ b/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\FunctionCall; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php b/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php index a41a71eb71..1a47318945 100644 --- a/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php +++ b/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\IntegerNegation; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PhpParser\Node\Scalar\LNumber; use PhpParser\Node\Stmt\Return_; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php b/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php index d809bcc8a5..308113f60e 100644 --- a/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php +++ b/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\NewObject; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/ReturnValue/ThisTest.php b/tests/phpunit/Mutator/ReturnValue/ThisTest.php index 4113e305bd..0aaae1189a 100644 --- a/tests/phpunit/Mutator/ReturnValue/ThisTest.php +++ b/tests/phpunit/Mutator/ReturnValue/ThisTest.php @@ -35,12 +35,12 @@ namespace Infection\Tests\Mutator\ReturnValue; -use Infection\Mutator\ReturnValue\This; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; +use This; #[Group('integration')] #[CoversClass(This::class)] diff --git a/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php b/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php index 7f91d20e55..f7823a5bbe 100644 --- a/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php +++ b/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\ReturnValue; use Infection\Mutator\ReturnValue\YieldValue; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Sort/SpaceshipTest.php b/tests/phpunit/Mutator/Sort/SpaceshipTest.php index 557d12b09e..e7a2399b12 100644 --- a/tests/phpunit/Mutator/Sort/SpaceshipTest.php +++ b/tests/phpunit/Mutator/Sort/SpaceshipTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Sort; use Infection\Mutator\Sort\Spaceship; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/SyntaxErrorTest.php b/tests/phpunit/Mutator/SyntaxErrorTest.php index 7c81971f39..f25726b306 100644 --- a/tests/phpunit/Mutator/SyntaxErrorTest.php +++ b/tests/phpunit/Mutator/SyntaxErrorTest.php @@ -36,6 +36,7 @@ namespace Infection\Tests\Mutator; use Infection\Mutator\SyntaxError; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php index eb20169a12..ddb354c7ab 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayChangeKeyCase; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php index cc7dcafe9d..f6752e03bc 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayChunk; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php index 33d91a2508..8d5d9b82a8 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayColumn; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php index 728556969f..43bb64c4d9 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayCombine; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php index c1ba7cd158..855b8d19ff 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayDiffAssoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php index 8d9c6c4b6a..fab79773b9 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayDiffKey; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php index 5b34027fd7..19c15eab05 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayDiff; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php index a9bd14446f..20272965a4 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayDiffUassoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php index a385afd7a0..b3bb400a53 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayDiffUkey; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php index 49907cb6d0..c8f21d204f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayFilter; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php index 43b5d9551f..b8f784c414 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayFlip; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php index bc2b5e50ac..bfbd3a4fce 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayIntersectAssoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php index 233d7c8ac4..54edfd2e72 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayIntersectKey; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php index b91c5d4673..75d2558b16 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayIntersect; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php index 1fba638312..85705903ac 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayIntersectUassoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php index 40e0917acb..37637e2aa5 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayIntersectUkey; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php index 44b1782cb3..c0dc3ddbbf 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayKeys; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php index 4e5102ee9f..237961581d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayMap; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php index a151376202..387e4764b9 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayMergeRecursive; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php index 0a7ad056aa..d9fe31831c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayMerge; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php index 1db73fe8d1..80a0a7ff28 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayPad; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php index 530cfa94a6..ff22ecb825 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayReduce; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php index 64ac1d90a9..186f93db42 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayReplaceRecursive; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php index 309a345686..bfb8e90b62 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayReplace; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php index 2f970adaf0..e5506acf29 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayReverse; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php index d35c0383cd..118caaa48c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArraySlice; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php index 83ac8bfc14..e78d47198f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArraySplice; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php index 7f30c93e7e..fa3ac04cfa 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUdiffAssoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php index 1b1900d904..a120d0de4d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUdiff; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php index 53950dc4cc..cc21229cbc 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUdiffUassoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php index d6c34fa043..c5a7997965 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUintersectAssoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php index b504b1b19e..62ac303962 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUintersect; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php index ae18353ab7..c1bc9bdb15 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUintersectUassoc; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php index 342ed08a6b..9629275a04 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayUnique; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php index 54ed3ae097..81e26552dc 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapArrayValues; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php index 5e7221bd7d..cabca0f87c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapFinally; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php index f457c92b8e..f83454a99d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapLcFirst; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php index 2706456593..75559c7e05 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapLtrim; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php index e563376653..c1edd6ccad 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapRtrim; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php index f5ed6dd45e..13b6a6038c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrIreplace; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php index 27c558309a..b2b28f4186 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrRepeat; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php index c338c53bd6..c34dbd0755 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrReplace; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php index 5a7a228954..bada097e55 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrRev; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php index 91c2b7ec7f..20f58989ec 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrShuffle; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php index b34ba210f0..11407633f5 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrToLower; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php index 30e1db220b..ee78c67984 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapStrToUpper; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php index 92c3a6333b..f5e68be8bf 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapSubstr; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php index f2550a0993..1e9fd41bb2 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapTrim; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php index 0a16ca11bb..2954ead0a1 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapUcFirst; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php index d3cff552a2..ca3d7d8ace 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\Mutator\Unwrap; use Infection\Mutator\Unwrap\UnwrapUcWords; -use Infection\Tests\Mutator\BaseMutatorTestCase; +use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/tests/phpunit/MutatorNameTest.php b/tests/phpunit/MutatorNameTest.php index 11c75e4203..864333ced2 100644 --- a/tests/phpunit/MutatorNameTest.php +++ b/tests/phpunit/MutatorNameTest.php @@ -35,7 +35,7 @@ namespace Infection\Tests; -use Infection\Tests\Mutator\MutatorName; +use Infection\Testing\MutatorName; use Infection\Tests\Mutator\ProfileListProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProviderExternal; diff --git a/tests/phpunit/PhpParser/FileParserTest.php b/tests/phpunit/PhpParser/FileParserTest.php index 0ae00b54e5..ee53e58275 100644 --- a/tests/phpunit/PhpParser/FileParserTest.php +++ b/tests/phpunit/PhpParser/FileParserTest.php @@ -37,8 +37,8 @@ use Infection\PhpParser\FileParser; use Infection\PhpParser\UnparsableFile; -use Infection\Tests\SingletonContainer; -use Infection\Tests\StringNormalizer; +use Infection\Testing\SingletonContainer; +use Infection\Testing\StringNormalizer; use PhpParser\Error; use PhpParser\Node; use PhpParser\Parser; @@ -46,9 +46,9 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; +use Symfony\Component\Finder\SplFileInfo; use function Safe\realpath; use function sprintf; -use Symfony\Component\Finder\SplFileInfo; #[Group('integration')] #[CoversClass(FileParser::class)] diff --git a/tests/phpunit/PhpParser/Visitor/BaseVisitorTestCase.php b/tests/phpunit/PhpParser/Visitor/BaseVisitorTestCase.php index a1448475a7..c7c67c160d 100644 --- a/tests/phpunit/PhpParser/Visitor/BaseVisitorTestCase.php +++ b/tests/phpunit/PhpParser/Visitor/BaseVisitorTestCase.php @@ -35,7 +35,7 @@ namespace Infection\Tests\PhpParser\Visitor; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PhpParser\Node; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor; diff --git a/tests/phpunit/PhpParser/Visitor/CloneVisitorTest.php b/tests/phpunit/PhpParser/Visitor/CloneVisitorTest.php index 15d271ee7e..d50547d20a 100644 --- a/tests/phpunit/PhpParser/Visitor/CloneVisitorTest.php +++ b/tests/phpunit/PhpParser/Visitor/CloneVisitorTest.php @@ -36,7 +36,7 @@ namespace Infection\Tests\PhpParser\Visitor; use Infection\PhpParser\Visitor\CloneVisitor; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PhpParser\Node; use PhpParser\NodeVisitor; use PhpParser\NodeVisitorAbstract; diff --git a/tests/phpunit/PhpParser/Visitor/IgnoreNode/BaseNodeIgnorerTestCase.php b/tests/phpunit/PhpParser/Visitor/IgnoreNode/BaseNodeIgnorerTestCase.php index 786fe38dce..4affb3a3ce 100644 --- a/tests/phpunit/PhpParser/Visitor/IgnoreNode/BaseNodeIgnorerTestCase.php +++ b/tests/phpunit/PhpParser/Visitor/IgnoreNode/BaseNodeIgnorerTestCase.php @@ -37,7 +37,7 @@ use Infection\PhpParser\Visitor\IgnoreNode\NodeIgnorer; use Infection\PhpParser\Visitor\NonMutableNodesIgnorerVisitor; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/PhpParser/Visitor/MutatorVisitorTest.php b/tests/phpunit/PhpParser/Visitor/MutatorVisitorTest.php index 79cf009e16..265d927b0f 100644 --- a/tests/phpunit/PhpParser/Visitor/MutatorVisitorTest.php +++ b/tests/phpunit/PhpParser/Visitor/MutatorVisitorTest.php @@ -39,9 +39,9 @@ use Infection\Mutator\FunctionSignature\PublicVisibility; use Infection\PhpParser\MutatedNode; use Infection\PhpParser\Visitor\MutatorVisitor; -use Infection\Tests\Mutator\MutatorName; -use Infection\Tests\SingletonContainer; -use Infection\Tests\StringNormalizer; +use Infection\Testing\MutatorName; +use Infection\Testing\SingletonContainer; +use Infection\Testing\StringNormalizer; use PhpParser\Node; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Nop; diff --git a/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php b/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php index 71809e530b..7616ccbfbb 100644 --- a/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php +++ b/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php @@ -35,7 +35,6 @@ namespace Infection\Tests\Process\Factory; -use function current; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\AbstractTestFramework\TestFrameworkAdapter; use Infection\Event\MutantProcessWasFinished; @@ -45,13 +44,14 @@ use Infection\Mutator\Loop\For_; use Infection\PhpParser\MutatedNode; use Infection\Process\Factory\MutantProcessFactory; +use Infection\Testing\MutatorName; use Infection\Tests\Fixtures\Event\EventDispatcherCollector; use Infection\Tests\Mutant\MutantBuilder; -use Infection\Tests\Mutator\MutatorName; -use const PHP_OS_FAMILY; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; +use function current; +use const PHP_OS_FAMILY; #[CoversClass(MutantProcessFactory::class)] final class MutantProcessFactoryTest extends TestCase diff --git a/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php b/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php index 126c189bf9..c4aaad9581 100644 --- a/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php +++ b/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php @@ -35,10 +35,7 @@ namespace Infection\Tests\Process\Runner; -use function array_map; use ArrayIterator; -use function count; -use function implode; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Differ\DiffSourceCodeMatcher; use Infection\Event\MutantProcessWasFinished; @@ -53,9 +50,9 @@ use Infection\Process\MutantProcess; use Infection\Process\Runner\MutationTestingRunner; use Infection\Process\Runner\ProcessRunner; +use Infection\Testing\MutatorName; use Infection\Tests\Fixtures\Event\EventDispatcherCollector; use Infection\Tests\Mutant\MutantBuilder; -use Infection\Tests\Mutator\MutatorName; use Infection\Tests\WithConsecutive; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; @@ -63,8 +60,11 @@ use PHPUnit\Framework\Constraint\Callback; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use function sprintf; use Symfony\Component\Filesystem\Filesystem; +use function array_map; +use function count; +use function implode; +use function sprintf; #[Group('integration')] #[CoversClass(MutationTestingRunner::class)] diff --git a/tests/phpunit/StringNormalizerTest.php b/tests/phpunit/StringNormalizerTest.php index 23244f2c76..a208d58a83 100644 --- a/tests/phpunit/StringNormalizerTest.php +++ b/tests/phpunit/StringNormalizerTest.php @@ -35,6 +35,7 @@ namespace Infection\Tests; +use Infection\Testing\StringNormalizer; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/phpunit/TestFramework/Coverage/LineRangeCalculatorTest.php b/tests/phpunit/TestFramework/Coverage/LineRangeCalculatorTest.php index fea7d5504f..6cf29b34a3 100644 --- a/tests/phpunit/TestFramework/Coverage/LineRangeCalculatorTest.php +++ b/tests/phpunit/TestFramework/Coverage/LineRangeCalculatorTest.php @@ -37,7 +37,7 @@ use Infection\PhpParser\Visitor\ReflectionVisitor; use Infection\TestFramework\Coverage\LineRangeCalculator; -use Infection\Tests\SingletonContainer; +use Infection\Testing\SingletonContainer; use PhpParser\Node; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\ParentConnectingVisitor; From c1841e451259d49a94e78e3fb8b0cab21b4aa38e Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 20 May 2024 18:57:18 +0200 Subject: [PATCH 03/25] Update failure message for BaseMutatorTestCase --- src/Testing/BaseMutatorTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testing/BaseMutatorTestCase.php b/src/Testing/BaseMutatorTestCase.php index 3bc69871fc..962945014a 100644 --- a/src/Testing/BaseMutatorTestCase.php +++ b/src/Testing/BaseMutatorTestCase.php @@ -86,7 +86,7 @@ final public function doTest(string $inputCode, $expectedCode = [], array $setti count($mutants), $expectedCodeSamples, sprintf( - 'Failed asserting that the number of code samples (%d) equals the number of mutants (%d) created by the mutator. Mutants are: %s', + 'Failed asserting that the number of code samples (%d) equals the number of mutants (%d) created by the mutator. Make sure mutator is enabled and mutates the source code. Mutants are: %s', count($expectedCodeSamples), count($mutants), StringNormalizer::normalizeString(implode(PHP_EOL, $mutants)), From e708ea60ce974ea8bb306a2e434fe328d0933269 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 20 May 2024 19:13:54 +0200 Subject: [PATCH 04/25] Fix autoreview analysis --- devTools/phpstan-src-baseline.neon | 80 +++++++++++++++ devTools/phpstan-src.neon | 2 + infection.json5 | 2 +- psalm.xml | 2 + src/Command/CustomMutatorCommand.php | 23 ++--- src/Console/Application.php | 2 +- src/CustomMutator/templates/__Name__.php | 31 ++++++ src/CustomMutator/templates/__Name__Test.php | 99 ++++++++++++------- src/Testing/BaseMutatorTestCase.php | 16 +-- src/Testing/MutatorName.php | 5 +- src/Testing/SimpleMutation.php | 41 +++++++- .../SimpleMutationsCollectorVisitor.php | 42 +++++++- src/Testing/SingletonContainer.php | 2 + src/Testing/SourceTestClassNameScheme.php | 3 + src/Testing/StringNormalizer.php | 5 +- tests/phpunit/AutoReview/ContainerTest.php | 6 +- .../EnvTestCasesProvider.php | 12 +-- .../IntegrationGroupProvider.php | 12 +-- .../ProjectCode/ProjectCodeProvider.php | 19 ++++ .../ProjectCode/ProjectCodeTest.php | 14 +-- .../ConfigurationFactoryTest.php | 2 +- tests/phpunit/Console/E2ETest.php | 34 +++---- .../Html/StrykerHtmlReportBuilderTest.php | 10 +- .../Metrics/CreateMutantExecutionResult.php | 2 +- .../SortableMutantExecutionResultsTest.php | 2 +- .../Mutant/MutantExecutionResultTest.php | 2 +- tests/phpunit/Mutant/MutantTest.php | 2 +- .../Mutation/FileMutationGeneratorTest.php | 6 +- tests/phpunit/Mutation/MutationTest.php | 4 +- tests/phpunit/Mutator/DefinitionTest.php | 6 +- .../phpunit/Mutator/Extensions/BCMathTest.php | 4 +- .../Mutator/Extensions/MBStringTest.php | 2 +- tests/phpunit/Mutator/IgnoreMutatorTest.php | 2 +- tests/phpunit/Mutator/MutatorFactoryTest.php | 8 +- .../Mutator/MutatorFixturesProvider.php | 8 +- tests/phpunit/Mutator/MutatorResolverTest.php | 6 +- .../phpunit/Mutator/MutatorRobustnessTest.php | 8 +- tests/phpunit/Mutator/NoopMutatorTest.php | 2 +- .../Mutator/Number/DecrementIntegerTest.php | 4 +- .../Mutator/Number/IncrementIntegerTest.php | 4 +- .../Operator/NullSafeMethodCallTest.php | 2 +- .../Operator/NullSafePropertyCallTest.php | 2 +- .../phpunit/Mutator/Operator/TernaryTest.php | 2 +- tests/phpunit/Mutator/ProfileListTest.php | 6 +- .../phpunit/Mutator/ReturnValue/ThisTest.php | 2 +- tests/phpunit/PhpParser/FileParserTest.php | 2 +- .../Factory/MutantProcessFactoryTest.php | 4 +- .../Runner/MutationTestingRunnerTest.php | 8 +- 48 files changed, 400 insertions(+), 164 deletions(-) diff --git a/devTools/phpstan-src-baseline.neon b/devTools/phpstan-src-baseline.neon index 86a3e8bbcd..be32229310 100644 --- a/devTools/phpstan-src-baseline.neon +++ b/devTools/phpstan-src-baseline.neon @@ -79,3 +79,83 @@ parameters: message: "#^Cannot access offset 0 on iterable\\<\\(int\\|string\\), string\\>\\|null\\.$#" count: 1 path: ../src/TestFramework/VersionParser.php + + - + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\)\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\)\\.$#" + count: 2 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:fail\\(\\)\\.$#" + count: 2 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Method Infection\\\\Testing\\\\BaseMutatorTestCase\\:\\:createMutator\\(\\) has parameter \\$settings with no value type specified in iterable type array\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Method Infection\\\\Testing\\\\BaseMutatorTestCase\\:\\:createMutator\\(\\) return type with generic interface Infection\\\\Mutator\\\\Mutator does not specify its types\\: TNode$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Method Infection\\\\Testing\\\\BaseMutatorTestCase\\:\\:getMutationsFromCode\\(\\) has parameter \\$settings with no value type specified in iterable type array\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Method Infection\\\\Testing\\\\BaseMutatorTestCase\\:\\:mutate\\(\\) has parameter \\$settings with no value type specified in iterable type array\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Parameter \\#1 \\$nodes of method PhpParser\\\\NodeTraverserInterface\\:\\:traverse\\(\\) expects array\\, array\\\\|null given\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Parameter \\#1 \\$resolvedMutators of method Infection\\\\Mutator\\\\MutatorFactory\\:\\:create\\(\\) expects array\\\\>, array\\>, non\\-empty\\-array\\ given\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Parameter \\#2 \\$fileAst of class Infection\\\\Testing\\\\SimpleMutationsCollectorVisitor constructor expects array\\, array\\\\|null given\\.$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Property Infection\\\\Testing\\\\BaseMutatorTestCase\\:\\:\\$mutator with generic interface Infection\\\\Mutator\\\\Mutator does not specify its types\\: TNode$#" + count: 1 + path: ../src/Testing/BaseMutatorTestCase.php + + - + message: "#^Class Infection\\\\Testing\\\\SimpleMutation extends @final class Infection\\\\Mutation\\\\Mutation\\.$#" + count: 1 + path: ../src/Testing/SimpleMutation.php + + - + message: "#^Infection\\\\Testing\\\\SimpleMutation\\:\\:__construct\\(\\) does not call parent constructor from Infection\\\\Mutation\\\\Mutation\\.$#" + count: 1 + path: ../src/Testing/SimpleMutation.php + + - + message: "#^Method Infection\\\\Testing\\\\SimpleMutation\\:\\:__construct\\(\\) has parameter \\$mutator with generic interface Infection\\\\Mutator\\\\Mutator but does not specify its types\\: TNode$#" + count: 1 + path: ../src/Testing/SimpleMutation.php + + - + message: "#^Method Infection\\\\Testing\\\\SimpleMutation\\:\\:getMutator\\(\\) return type with generic interface Infection\\\\Mutator\\\\Mutator does not specify its types\\: TNode$#" + count: 1 + path: ../src/Testing/SimpleMutation.php + + - + message: "#^Cannot access offset 1 on iterable\\<\\(int\\|string\\), string\\>\\|null\\.$#" + count: 1 + path: ../src/Testing/SourceTestClassNameScheme.php diff --git a/devTools/phpstan-src.neon b/devTools/phpstan-src.neon index af3414d5af..8783936185 100644 --- a/devTools/phpstan-src.neon +++ b/devTools/phpstan-src.neon @@ -90,6 +90,8 @@ parameters: - %currentWorkingDirectory%/src/FileSystem/DummyFileSystem.php - %currentWorkingDirectory%/src/FileSystem/DummySymfony5FileSystem.php - %currentWorkingDirectory%/src/FileSystem/DummySymfony6FileSystem.php + - %currentWorkingDirectory%/src/CustomMutator/templates/__Name__.php + - %currentWorkingDirectory%/src/CustomMutator/templates/__Name__Test.php stubFiles: - phpstan.stub treatPhpDocTypesAsCertain: false diff --git a/infection.json5 b/infection.json5 index d534af4cc3..110754e09a 100644 --- a/infection.json5 +++ b/infection.json5 @@ -35,6 +35,6 @@ ignore: [ "Infection\\Mutator\\Boolean\\LogicalOr::canMutate" ] - }, + } } } diff --git a/psalm.xml b/psalm.xml index f506261f03..b71e9a513b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -13,6 +13,8 @@ + + diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 4be8364698..34ece5e66b 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -35,22 +35,17 @@ namespace Infection\Command; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Finder\Finder; -use function array_key_exists; -use function array_keys; use Infection\Console\IO; -use Infection\Mutator\Definition; -use Infection\Mutator\Mutator; -use Infection\Mutator\MutatorResolver; -use Infection\Mutator\ProfileList; -use function getcwd; use function iterator_to_array; +use RuntimeException; +use function Safe\getcwd; use function sprintf; +use function str_replace; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Question\Question; -use Webmozart\Assert\Assert; -use function str_replace; +use Symfony\Component\Finder\Finder; +use function trim; +use function ucfirst; /** * @internal @@ -71,9 +66,9 @@ protected function executeCommand(IO $io): bool if ($mutator === null) { $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); - $question->setValidator(function (string|null $answer): string { + $question->setValidator(static function (?string $answer): string { if ($answer === null || trim($answer) === '') { - throw new \RuntimeException('Mutator name is mandaory.'); + throw new RuntimeException('Mutator name is mandaory.'); } return $answer; @@ -112,7 +107,7 @@ protected function executeCommand(IO $io): bool $io->title('Generated files'); $io->listing($generatedFilePaths); $io->success( - sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutator) + sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutator), ); return true; diff --git a/src/Console/Application.php b/src/Console/Application.php index 504a771d3d..ae3d0f72b7 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -35,11 +35,11 @@ namespace Infection\Console; -use Infection\Command\CustomMutatorCommand; use function array_merge; use function class_exists; use Composer\InstalledVersions; use Infection\Command\ConfigureCommand; +use Infection\Command\CustomMutatorCommand; use Infection\Command\DescribeCommand; use Infection\Command\RunCommand; use Infection\Container; diff --git a/src/CustomMutator/templates/__Name__.php b/src/CustomMutator/templates/__Name__.php index 412ca2baf8..2b6ff49f31 100644 --- a/src/CustomMutator/templates/__Name__.php +++ b/src/CustomMutator/templates/__Name__.php @@ -1,4 +1,35 @@ [ -// <<<'PHP' -// [ + // <<<'PHP' + // [ + // <<<'PHP' + // [ -// <<<'PHP' -// mutator->canMutate($node)) { - return; + return null; } // It is important to not rely on the keys here. It might otherwise result in some elements @@ -46,9 +76,11 @@ public function leaveNode(Node $node) $this->mutator, MutatedNode::wrap($mutatedNode), $node->getAttributes(), - $node::class + $node::class, ); } + + return null; } /** diff --git a/src/Testing/SingletonContainer.php b/src/Testing/SingletonContainer.php index 45772a59fc..45c5fd241f 100644 --- a/src/Testing/SingletonContainer.php +++ b/src/Testing/SingletonContainer.php @@ -45,6 +45,8 @@ * Singleton for the container and a few services (used for tests). The goal is to avoid * instantiating multiple times stateless services across the tests to reduce the memory footprint * and remove some redundant code. + * + * @internal */ final class SingletonContainer { diff --git a/src/Testing/SourceTestClassNameScheme.php b/src/Testing/SourceTestClassNameScheme.php index d58bb25e9f..605dbc7f70 100644 --- a/src/Testing/SourceTestClassNameScheme.php +++ b/src/Testing/SourceTestClassNameScheme.php @@ -41,6 +41,9 @@ use function str_contains; use function str_replace; +/** + * @internal + */ final class SourceTestClassNameScheme { use CannotBeInstantiated; diff --git a/src/Testing/StringNormalizer.php b/src/Testing/StringNormalizer.php index 954f1cbf50..2ce4c385b5 100644 --- a/src/Testing/StringNormalizer.php +++ b/src/Testing/StringNormalizer.php @@ -35,11 +35,14 @@ namespace Infection\Testing; -use Infection\CannotBeInstantiated; use function array_map; use function explode; use function implode; +use Infection\CannotBeInstantiated; +/** + * @internal + */ final class StringNormalizer { use CannotBeInstantiated; diff --git a/tests/phpunit/AutoReview/ContainerTest.php b/tests/phpunit/AutoReview/ContainerTest.php index 617f496261..39161dd3ad 100644 --- a/tests/phpunit/AutoReview/ContainerTest.php +++ b/tests/phpunit/AutoReview/ContainerTest.php @@ -35,18 +35,18 @@ namespace Infection\Tests\AutoReview; +use function array_map; +use function in_array; use Infection\Testing\SingletonContainer; use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProviderExternal; use PHPUnit\Framework\TestCase; use ReflectionClass; -use Symfony\Component\Filesystem\Path; -use function array_map; -use function in_array; use function Safe\file_get_contents; use function sprintf; use function strpos; +use Symfony\Component\Filesystem\Path; #[CoversNothing] final class ContainerTest extends TestCase diff --git a/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php b/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php index f4703a7835..f6146b96d0 100644 --- a/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php +++ b/tests/phpunit/AutoReview/EnvVariableManipulation/EnvTestCasesProvider.php @@ -35,18 +35,18 @@ namespace Infection\Tests\AutoReview\EnvVariableManipulation; -use Infection\CannotBeInstantiated; -use Infection\Testing\SourceTestClassNameScheme; -use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; -use PHPUnit\Framework\TestCase; -use ReflectionClass; -use Webmozart\Assert\Assert; use function array_filter; use function array_map; use function array_values; use function class_exists; +use Infection\CannotBeInstantiated; +use Infection\Testing\SourceTestClassNameScheme; +use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; use function iterator_to_array; +use PHPUnit\Framework\TestCase; +use ReflectionClass; use function Safe\file_get_contents; +use Webmozart\Assert\Assert; final class EnvTestCasesProvider { diff --git a/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php b/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php index 3d8ef7520b..aaa0e8cc9f 100644 --- a/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php +++ b/tests/phpunit/AutoReview/IntegrationGroup/IntegrationGroupProvider.php @@ -35,20 +35,20 @@ namespace Infection\Tests\AutoReview\IntegrationGroup; +use function array_filter; +use function array_map; +use function array_values; +use function class_exists; use Infection\CannotBeInstantiated; use Infection\Testing\SourceTestClassNameScheme; use Infection\Tests\AutoReview\ProjectCode\ProjectCodeProvider; use Infection\Tests\Console\E2ETest; use Infection\Tests\FileSystem\FileSystemTestCase; +use function iterator_to_array; use PHPUnit\Framework\TestCase; use ReflectionClass; -use Webmozart\Assert\Assert; -use function array_filter; -use function array_map; -use function array_values; -use function class_exists; -use function iterator_to_array; use function Safe\file_get_contents; +use Webmozart\Assert\Assert; final class IntegrationGroupProvider { diff --git a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php index b3f56f59fe..9b4b5cc2aa 100644 --- a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php +++ b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php @@ -41,6 +41,7 @@ use function in_array; use Infection\CannotBeInstantiated; use Infection\Command\ConfigureCommand; +use Infection\Command\CustomMutatorCommand; use Infection\Config\ConsoleHelper; use Infection\Config\Guesser\SourceDirGuesser; use Infection\Configuration\Schema\SchemaConfigurationFactory; @@ -79,6 +80,13 @@ use Infection\TestFramework\MapSourceClassToTestStrategy; use Infection\TestFramework\PhpUnit\Config\Builder\InitialConfigBuilder as PhpUnitInitalConfigBuilder; use Infection\TestFramework\PhpUnit\Config\Builder\MutationConfigBuilder as PhpUnitMutationConfigBuilder; +use Infection\Testing\BaseMutatorTestCase; +use Infection\Testing\MutatorName; +use Infection\Testing\SimpleMutation; +use Infection\Testing\SimpleMutationsCollectorVisitor; +use Infection\Testing\SingletonContainer; +use Infection\Testing\SourceTestClassNameScheme; +use Infection\Testing\StringNormalizer; use Infection\Tests\AutoReview\ConcreteClassReflector; use function Infection\Tests\generator_to_phpunit_data_provider; use function iterator_to_array; @@ -120,6 +128,14 @@ final class ProjectCodeProvider DispatchPcntlSignalSubscriber::class, StopInfectionOnSigintSignalSubscriber::class, MapSourceClassToTestStrategy::class, // no need to test 1 const for now + MutatorName::class, + BaseMutatorTestCase::class, + SimpleMutation::class, + StringNormalizer::class, + SourceTestClassNameScheme::class, + SimpleMutationsCollectorVisitor::class, + CustomMutatorCommand::class, + SingletonContainer::class, ]; /** @@ -147,6 +163,7 @@ final class ProjectCodeProvider Mutator::class, Definition::class, MutatorCategory::class, + BaseMutatorTestCase::class, ]; /** @@ -177,6 +194,8 @@ public static function provideSourceClasses(): iterable ->name('*.php') ->notName('DummySymfony5FileSystem.php') ->notName('DummySymfony6FileSystem.php') + ->notName('__Name__.php') + ->notName('__Name__Test.php') ->in(__DIR__ . '/../../../../src') ; diff --git a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php index 36449e25fd..93af8c3697 100644 --- a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php +++ b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeTest.php @@ -35,21 +35,21 @@ namespace Infection\Tests\AutoReview\ProjectCode; +use function array_filter; +use function array_flip; +use function array_key_exists; +use function array_map; +use function class_exists; +use function in_array; use Infection\StreamWrapper\IncludeInterceptor; use Infection\Testing\SingletonContainer; use Infection\Testing\SourceTestClassNameScheme; +use function is_executable; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProviderExternal; use PHPUnit\Framework\TestCase; use ReflectionClass; use ReflectionProperty; -use function array_filter; -use function array_flip; -use function array_key_exists; -use function array_map; -use function class_exists; -use function in_array; -use function is_executable; use function sprintf; /** diff --git a/tests/phpunit/Configuration/ConfigurationFactoryTest.php b/tests/phpunit/Configuration/ConfigurationFactoryTest.php index c422d9b159..929a70e741 100644 --- a/tests/phpunit/Configuration/ConfigurationFactoryTest.php +++ b/tests/phpunit/Configuration/ConfigurationFactoryTest.php @@ -57,6 +57,7 @@ use Infection\TestFramework\MapSourceClassToTestStrategy; use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\DummyCiDetector; +use function Infection\Tests\normalizePath; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; @@ -64,7 +65,6 @@ use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\ObjectProphecy; use Symfony\Component\Finder\SplFileInfo; -use function Infection\Tests\normalizePath; use function sys_get_temp_dir; #[Group('integration')] diff --git a/tests/phpunit/Console/E2ETest.php b/tests/phpunit/Console/E2ETest.php index 7c9b4239ae..b48f97e4c0 100644 --- a/tests/phpunit/Console/E2ETest.php +++ b/tests/phpunit/Console/E2ETest.php @@ -35,32 +35,31 @@ namespace Infection\Tests\Console; +use function array_merge; +use function basename; use Composer\Autoload\ClassLoader; +use const DIRECTORY_SEPARATOR; +use function extension_loaded; +use function file_exists; +use function function_exists; +use function getenv; +use function implode; use Infection\Command\ConfigureCommand; use Infection\Console\Application; use Infection\Console\E2E; use Infection\FileSystem\Finder\ComposerExecutableFinder; use Infection\FileSystem\Finder\Exception\FinderException; use Infection\Testing\SingletonContainer; +use function is_readable; +use const PHP_EOL; +use const PHP_OS; +use const PHP_SAPI; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Large; use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Output\BufferedOutput; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Process\Exception\ProcessTimedOutException; -use Symfony\Component\Process\Process; -use function array_merge; -use function basename; -use function extension_loaded; -use function file_exists; -use function function_exists; -use function getenv; -use function implode; -use function is_readable; use function Safe\chdir; use function Safe\copy; use function Safe\file_get_contents; @@ -70,10 +69,11 @@ use function str_contains; use function str_replace; use function str_starts_with; -use const DIRECTORY_SEPARATOR; -use const PHP_EOL; -use const PHP_OS; -use const PHP_SAPI; +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Process; #[Group('e2e')] #[Group('integration')] diff --git a/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php b/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php index 0648d65e38..fd926d8476 100644 --- a/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php +++ b/tests/phpunit/Logger/Html/StrykerHtmlReportBuilderTest.php @@ -35,6 +35,8 @@ namespace Infection\Tests\Logger\Html; +use function array_map; +use function implode; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Logger\Html\StrykerHtmlReportBuilder; use Infection\Metrics\Collector; @@ -46,22 +48,20 @@ use Infection\Mutator\Removal\ArrayItemRemoval; use Infection\Mutator\Removal\MethodCallRemoval; use Infection\Testing\MutatorName; +use function Infection\Tests\normalize_trailing_spaces; use JsonSchema\Validator; +use function Later\now; +use const PHP_EOL; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use function array_map; -use function implode; -use function Infection\Tests\normalize_trailing_spaces; -use function Later\now; use function Safe\base64_decode; use function Safe\file_get_contents; use function Safe\json_decode; use function Safe\json_encode; use function Safe\realpath; use function sprintf; -use const PHP_EOL; #[Group('integration')] #[CoversClass(StrykerHtmlReportBuilder::class)] diff --git a/tests/phpunit/Metrics/CreateMutantExecutionResult.php b/tests/phpunit/Metrics/CreateMutantExecutionResult.php index 8300e266a2..db128e259f 100644 --- a/tests/phpunit/Metrics/CreateMutantExecutionResult.php +++ b/tests/phpunit/Metrics/CreateMutantExecutionResult.php @@ -40,8 +40,8 @@ use Infection\Mutator\Loop\For_; use Infection\Testing\MutatorName; use function Later\now; -use function str_replace; use const PHP_EOL; +use function str_replace; trait CreateMutantExecutionResult { diff --git a/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php b/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php index 8b607cd6fd..eef2d66e21 100644 --- a/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php +++ b/tests/phpunit/Metrics/SortableMutantExecutionResultsTest.php @@ -40,10 +40,10 @@ use Infection\Mutant\MutantExecutionResult; use Infection\Mutator\Loop\For_; use Infection\Testing\MutatorName; +use function Later\now; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use function Later\now; #[CoversClass(SortableMutantExecutionResults::class)] final class SortableMutantExecutionResultsTest extends TestCase diff --git a/tests/phpunit/Mutant/MutantExecutionResultTest.php b/tests/phpunit/Mutant/MutantExecutionResultTest.php index d1ea5194d0..cb78833120 100644 --- a/tests/phpunit/Mutant/MutantExecutionResultTest.php +++ b/tests/phpunit/Mutant/MutantExecutionResultTest.php @@ -42,10 +42,10 @@ use Infection\Mutator\Loop\For_; use Infection\PhpParser\MutatedNode; use Infection\Testing\MutatorName; +use function Later\now; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use function Later\now; #[CoversClass(MutantExecutionResult::class)] final class MutantExecutionResultTest extends TestCase diff --git a/tests/phpunit/Mutant/MutantTest.php b/tests/phpunit/Mutant/MutantTest.php index e12824e377..00fd1f5a40 100644 --- a/tests/phpunit/Mutant/MutantTest.php +++ b/tests/phpunit/Mutant/MutantTest.php @@ -41,11 +41,11 @@ use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; use Infection\Testing\MutatorName; +use function Later\now; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use function Later\now; #[CoversClass(Mutant::class)] final class MutantTest extends TestCase diff --git a/tests/phpunit/Mutation/FileMutationGeneratorTest.php b/tests/phpunit/Mutation/FileMutationGeneratorTest.php index 51cd0ef459..41f7e6855b 100644 --- a/tests/phpunit/Mutation/FileMutationGeneratorTest.php +++ b/tests/phpunit/Mutation/FileMutationGeneratorTest.php @@ -35,6 +35,7 @@ namespace Infection\Tests\Mutation; +use function current; use Infection\Differ\FilesDiffChangedLines; use Infection\Mutation\FileMutationGenerator; use Infection\Mutation\Mutation; @@ -50,15 +51,14 @@ use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\PhpParser\FakeIgnorer; use Infection\Tests\Fixtures\PhpParser\FakeNode; +use function iterator_to_array; use PhpParser\NodeTraverserInterface; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Symfony\Component\Finder\SplFileInfo; -use function current; -use function iterator_to_array; use function sprintf; +use Symfony\Component\Finder\SplFileInfo; #[CoversClass(FileMutationGenerator::class)] final class FileMutationGeneratorTest extends TestCase diff --git a/tests/phpunit/Mutation/MutationTest.php b/tests/phpunit/Mutation/MutationTest.php index 470e23b325..22aa1b9907 100644 --- a/tests/phpunit/Mutation/MutationTest.php +++ b/tests/phpunit/Mutation/MutationTest.php @@ -35,17 +35,17 @@ namespace Infection\Tests\Mutation; +use function array_merge; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Mutation\Mutation; use Infection\Mutator\Arithmetic\Plus; use Infection\PhpParser\MutatedNode; use Infection\Testing\MutatorName; +use function md5; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use function array_merge; -use function md5; #[CoversClass(Mutation::class)] final class MutationTest extends TestCase diff --git a/tests/phpunit/Mutator/DefinitionTest.php b/tests/phpunit/Mutator/DefinitionTest.php index 6d2d97f117..e1657a7e22 100644 --- a/tests/phpunit/Mutator/DefinitionTest.php +++ b/tests/phpunit/Mutator/DefinitionTest.php @@ -35,6 +35,9 @@ namespace Infection\Tests\Mutator; +use function array_diff_key; +use function array_fill_keys; +use function array_flip; use Infection\Mutator\Definition; use Infection\Mutator\Mutator; use Infection\Mutator\MutatorCategory; @@ -43,9 +46,6 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use function array_diff_key; -use function array_fill_keys; -use function array_flip; use function sprintf; #[CoversClass(Definition::class)] diff --git a/tests/phpunit/Mutator/Extensions/BCMathTest.php b/tests/phpunit/Mutator/Extensions/BCMathTest.php index edbf86e7b7..47389eb49b 100644 --- a/tests/phpunit/Mutator/Extensions/BCMathTest.php +++ b/tests/phpunit/Mutator/Extensions/BCMathTest.php @@ -35,12 +35,12 @@ namespace Infection\Tests\Mutator\Extensions; +use function array_map; +use function implode; use Infection\Mutator\Extensions\BCMath; use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use function array_map; -use function implode; use function range; use function strtoupper; use function ucfirst; diff --git a/tests/phpunit/Mutator/Extensions/MBStringTest.php b/tests/phpunit/Mutator/Extensions/MBStringTest.php index 408a616841..a18fd26210 100644 --- a/tests/phpunit/Mutator/Extensions/MBStringTest.php +++ b/tests/phpunit/Mutator/Extensions/MBStringTest.php @@ -35,11 +35,11 @@ namespace Infection\Tests\Mutator\Extensions; +use function defined; use Infection\Mutator\Extensions\MBString; use Infection\Testing\BaseMutatorTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use function defined; use function Safe\define; #[CoversClass(MBString::class)] diff --git a/tests/phpunit/Mutator/IgnoreMutatorTest.php b/tests/phpunit/Mutator/IgnoreMutatorTest.php index 11d56df1b0..e2dcfb4cf7 100644 --- a/tests/phpunit/Mutator/IgnoreMutatorTest.php +++ b/tests/phpunit/Mutator/IgnoreMutatorTest.php @@ -44,11 +44,11 @@ use Infection\Reflection\CoreClassReflection; use Infection\Testing\MutatorName; use Infection\Tests\WithConsecutive; +use function iterator_to_array; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use function iterator_to_array; #[CoversClass(IgnoreMutator::class)] final class IgnoreMutatorTest extends TestCase diff --git a/tests/phpunit/Mutator/MutatorFactoryTest.php b/tests/phpunit/Mutator/MutatorFactoryTest.php index 6961b7dfcd..736740bf15 100644 --- a/tests/phpunit/Mutator/MutatorFactoryTest.php +++ b/tests/phpunit/Mutator/MutatorFactoryTest.php @@ -35,6 +35,9 @@ namespace Infection\Tests\Mutator; +use function array_fill_keys; +use function array_values; +use function count; use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\Boolean\TrueValue; use Infection\Mutator\IgnoreMutator; @@ -52,11 +55,8 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionClass; -use stdClass; -use function array_fill_keys; -use function array_values; -use function count; use function sprintf; +use stdClass; #[CoversClass(MutatorFactory::class)] final class MutatorFactoryTest extends TestCase diff --git a/tests/phpunit/Mutator/MutatorFixturesProvider.php b/tests/phpunit/Mutator/MutatorFixturesProvider.php index 6d99a5cb70..eebda8cfd9 100644 --- a/tests/phpunit/Mutator/MutatorFixturesProvider.php +++ b/tests/phpunit/Mutator/MutatorFixturesProvider.php @@ -35,16 +35,16 @@ namespace Infection\Tests\Mutator; -use Infection\CannotBeInstantiated; -use Infection\Testing\BaseMutatorTestCase; -use Symfony\Component\Filesystem\Path; -use Webmozart\Assert\Assert; use function array_key_exists; use function end; use function explode; +use Infection\CannotBeInstantiated; +use Infection\Testing\BaseMutatorTestCase; use function Safe\file_get_contents; use function sprintf; use function substr; +use Symfony\Component\Filesystem\Path; +use Webmozart\Assert\Assert; final class MutatorFixturesProvider { diff --git a/tests/phpunit/Mutator/MutatorResolverTest.php b/tests/phpunit/Mutator/MutatorResolverTest.php index 3dd9ee4775..20c2cb573a 100644 --- a/tests/phpunit/Mutator/MutatorResolverTest.php +++ b/tests/phpunit/Mutator/MutatorResolverTest.php @@ -35,6 +35,9 @@ namespace Infection\Tests\Mutator; +use function array_diff; +use function array_values; +use function count; use Infection\Mutator\Arithmetic\Minus; use Infection\Mutator\Arithmetic\Plus; use Infection\Mutator\Boolean\IdenticalEqual; @@ -52,9 +55,6 @@ use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use function array_diff; -use function array_values; -use function count; use function sprintf; #[CoversClass(MutatorResolver::class)] diff --git a/tests/phpunit/Mutator/MutatorRobustnessTest.php b/tests/phpunit/Mutator/MutatorRobustnessTest.php index 913588fea5..eeeb3e5f99 100644 --- a/tests/phpunit/Mutator/MutatorRobustnessTest.php +++ b/tests/phpunit/Mutator/MutatorRobustnessTest.php @@ -35,22 +35,22 @@ namespace Infection\Tests\Mutator; +use function array_values; use Infection\Mutator\Mutator; use Infection\Mutator\ProfileList; use Infection\PhpParser\NodeTraverserFactory; use Infection\Testing\MutatorName; use Infection\Testing\SingletonContainer; use Infection\Tests\Fixtures\NullMutationVisitor; +use function ksort; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use const SORT_STRING; +use function sprintf; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; use Throwable; -use function array_values; -use function ksort; -use function sprintf; -use const SORT_STRING; #[CoversNothing] final class MutatorRobustnessTest extends TestCase diff --git a/tests/phpunit/Mutator/NoopMutatorTest.php b/tests/phpunit/Mutator/NoopMutatorTest.php index 3d1c675784..1b291ca89f 100644 --- a/tests/phpunit/Mutator/NoopMutatorTest.php +++ b/tests/phpunit/Mutator/NoopMutatorTest.php @@ -40,11 +40,11 @@ use Infection\Mutator\Mutator; use Infection\Mutator\NoopMutator; use Infection\Testing\MutatorName; +use function iterator_to_array; use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use function iterator_to_array; #[CoversClass(NoopMutator::class)] final class NoopMutatorTest extends TestCase diff --git a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php index c64d54379f..f83f455447 100644 --- a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php @@ -37,10 +37,10 @@ use Infection\Mutator\Number\DecrementInteger; use Infection\Testing\BaseMutatorTestCase; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\DataProvider; use const PHP_INT_MAX; use const PHP_INT_MIN; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; #[CoversClass(DecrementInteger::class)] final class DecrementIntegerTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php index 85cdeae644..a64709bf04 100644 --- a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php @@ -37,10 +37,10 @@ use Infection\Mutator\Number\IncrementInteger; use Infection\Testing\BaseMutatorTestCase; -use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\DataProvider; use const PHP_INT_MAX; use const PHP_INT_MIN; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; #[CoversClass(IncrementInteger::class)] final class IncrementIntegerTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php index bf06d58575..e265c7e96e 100644 --- a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php @@ -37,9 +37,9 @@ use Infection\Mutator\Operator\NullSafeMethodCall; use Infection\Testing\BaseMutatorTestCase; +use const PHP_VERSION_ID; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use const PHP_VERSION_ID; #[CoversClass(NullSafeMethodCall::class)] final class NullSafeMethodCallTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php index ab65e5fbda..ac76cd0db7 100644 --- a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php @@ -37,9 +37,9 @@ use Infection\Mutator\Operator\NullSafePropertyCall; use Infection\Testing\BaseMutatorTestCase; +use const PHP_VERSION_ID; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use const PHP_VERSION_ID; #[CoversClass(NullSafePropertyCall::class)] final class NullSafePropertyCallTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/Operator/TernaryTest.php b/tests/phpunit/Mutator/Operator/TernaryTest.php index f85f10c4eb..d86d532646 100644 --- a/tests/phpunit/Mutator/Operator/TernaryTest.php +++ b/tests/phpunit/Mutator/Operator/TernaryTest.php @@ -37,9 +37,9 @@ use Infection\Mutator\Operator\Ternary; use Infection\Testing\BaseMutatorTestCase; +use const PHP_VERSION_ID; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use const PHP_VERSION_ID; #[CoversClass(Ternary::class)] final class TernaryTest extends BaseMutatorTestCase diff --git a/tests/phpunit/Mutator/ProfileListTest.php b/tests/phpunit/Mutator/ProfileListTest.php index 450361510a..83efdd8daf 100644 --- a/tests/phpunit/Mutator/ProfileListTest.php +++ b/tests/phpunit/Mutator/ProfileListTest.php @@ -35,16 +35,16 @@ namespace Infection\Tests\Mutator; +use function array_keys; +use function in_array; use Infection\Mutator\ProfileList; use Infection\Testing\MutatorName; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProviderExternal; use PHPUnit\Framework\TestCase; -use function array_keys; -use function in_array; use function Safe\sort; -use function sprintf; use const SORT_STRING; +use function sprintf; #[CoversClass(ProfileList::class)] final class ProfileListTest extends TestCase diff --git a/tests/phpunit/Mutator/ReturnValue/ThisTest.php b/tests/phpunit/Mutator/ReturnValue/ThisTest.php index 0aaae1189a..602c2b7594 100644 --- a/tests/phpunit/Mutator/ReturnValue/ThisTest.php +++ b/tests/phpunit/Mutator/ReturnValue/ThisTest.php @@ -35,12 +35,12 @@ namespace Infection\Tests\Mutator\ReturnValue; +use Infection\Mutator\ReturnValue\This; use Infection\Testing\BaseMutatorTestCase; use Infection\Tests\Mutator\MutatorFixturesProvider; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; -use This; #[Group('integration')] #[CoversClass(This::class)] diff --git a/tests/phpunit/PhpParser/FileParserTest.php b/tests/phpunit/PhpParser/FileParserTest.php index ee53e58275..909228633f 100644 --- a/tests/phpunit/PhpParser/FileParserTest.php +++ b/tests/phpunit/PhpParser/FileParserTest.php @@ -46,9 +46,9 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; -use Symfony\Component\Finder\SplFileInfo; use function Safe\realpath; use function sprintf; +use Symfony\Component\Finder\SplFileInfo; #[Group('integration')] #[CoversClass(FileParser::class)] diff --git a/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php b/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php index 7616ccbfbb..d5a3edce33 100644 --- a/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php +++ b/tests/phpunit/Process/Factory/MutantProcessFactoryTest.php @@ -35,6 +35,7 @@ namespace Infection\Tests\Process\Factory; +use function current; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\AbstractTestFramework\TestFrameworkAdapter; use Infection\Event\MutantProcessWasFinished; @@ -47,11 +48,10 @@ use Infection\Testing\MutatorName; use Infection\Tests\Fixtures\Event\EventDispatcherCollector; use Infection\Tests\Mutant\MutantBuilder; +use const PHP_OS_FAMILY; use PhpParser\Node\Stmt\Nop; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use function current; -use const PHP_OS_FAMILY; #[CoversClass(MutantProcessFactory::class)] final class MutantProcessFactoryTest extends TestCase diff --git a/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php b/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php index c4aaad9581..3359f20d2e 100644 --- a/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php +++ b/tests/phpunit/Process/Runner/MutationTestingRunnerTest.php @@ -35,7 +35,10 @@ namespace Infection\Tests\Process\Runner; +use function array_map; use ArrayIterator; +use function count; +use function implode; use Infection\AbstractTestFramework\Coverage\TestLocation; use Infection\Differ\DiffSourceCodeMatcher; use Infection\Event\MutantProcessWasFinished; @@ -60,11 +63,8 @@ use PHPUnit\Framework\Constraint\Callback; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Symfony\Component\Filesystem\Filesystem; -use function array_map; -use function count; -use function implode; use function sprintf; +use Symfony\Component\Filesystem\Filesystem; #[Group('integration')] #[CoversClass(MutationTestingRunner::class)] From c3c5ab13cefa5292e4b0a957f012d29887805773 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 20 May 2024 21:59:08 +0200 Subject: [PATCH 05/25] Fix type --- src/Command/CustomMutatorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 34ece5e66b..ff901be36e 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -56,7 +56,7 @@ protected function configure(): void { $this ->setName('custom-mutator') - ->setDescription('Creates a cusotm mutator') + ->setDescription('Creates a custom mutator') ->addArgument('Mutator name', InputArgument::OPTIONAL); } From 0e2d370419afe0283e70d9a004418266f8fbc150 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 20 May 2024 22:04:19 +0200 Subject: [PATCH 06/25] Exclude template files from mutating --- infection.json5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infection.json5 b/infection.json5 index 110754e09a..d72c7e96f0 100644 --- a/infection.json5 +++ b/infection.json5 @@ -8,7 +8,9 @@ excludes: [ "FileSystem/DummyFileSystem.php", "FileSystem/DummySymfony5FileSystem.php", - "FileSystem/DummySymfony6FileSystem.php" + "FileSystem/DummySymfony6FileSystem.php", + "CustomMutator/templates/__Name__.php", + "CustomMutator/templates/__Name__Test.php", ] }, "logs": { From 3191313812ab03f189709d1ef60836b4fe2195df Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 12:38:23 +0200 Subject: [PATCH 07/25] Rename `$mutator` to `$mutatorName` --- src/Command/CustomMutatorCommand.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index ff901be36e..9ffc5911ed 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -62,9 +62,9 @@ protected function configure(): void protected function executeCommand(IO $io): bool { - $mutator = $io->getInput()->getArgument('Mutator name'); + $mutatorName = $io->getInput()->getArgument('Mutator name'); - if ($mutator === null) { + if ($mutatorName === null) { $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); $question->setValidator(static function (?string $answer): string { if ($answer === null || trim($answer) === '') { @@ -73,12 +73,12 @@ protected function executeCommand(IO $io): bool return $answer; }); - $mutator = $io->askQuestion( + $mutatorName = $io->askQuestion( $question, ); } - $mutator = ucfirst((string) $mutator); + $mutatorName = ucfirst((string) $mutatorName); // find all files in templates directory $finder = Finder::create() @@ -94,8 +94,8 @@ protected function executeCommand(IO $io): bool foreach ($fileInfos as $fileInfo) { // replace __Name__ with $mutator - $newContent = $this->replaceNameVariable($mutator, $fileInfo->getContents()); - $replacedNamePath = $this->replaceNameVariable($mutator, $fileInfo->getRelativePathname()); + $newContent = $this->replaceNameVariable($mutatorName, $fileInfo->getContents()); + $replacedNamePath = $this->replaceNameVariable($mutatorName, $fileInfo->getRelativePathname()); $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; @@ -107,7 +107,7 @@ protected function executeCommand(IO $io): bool $io->title('Generated files'); $io->listing($generatedFilePaths); $io->success( - sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutator), + sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutatorName), ); return true; From 92d5ac680c7fc04fd1268a8ae9634ec102cbf0ca Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 12:39:13 +0200 Subject: [PATCH 08/25] Fix typo --- src/Command/CustomMutatorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 9ffc5911ed..f936316e12 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -68,7 +68,7 @@ protected function executeCommand(IO $io): bool $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); $question->setValidator(static function (?string $answer): string { if ($answer === null || trim($answer) === '') { - throw new RuntimeException('Mutator name is mandaory.'); + throw new RuntimeException('Mutator name is mandatory.'); } return $answer; From d23b6c7ce60202275507534b92cef6d3ab9172aa Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 12:40:25 +0200 Subject: [PATCH 09/25] Move asking mutator name to separate private function --- src/Command/CustomMutatorCommand.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index f936316e12..2a65579bfc 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -65,17 +65,7 @@ protected function executeCommand(IO $io): bool $mutatorName = $io->getInput()->getArgument('Mutator name'); if ($mutatorName === null) { - $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); - $question->setValidator(static function (?string $answer): string { - if ($answer === null || trim($answer) === '') { - throw new RuntimeException('Mutator name is mandatory.'); - } - - return $answer; - }); - $mutatorName = $io->askQuestion( - $question, - ); + $mutatorName = $this->askMutatorName($io); } $mutatorName = ucfirst((string) $mutatorName); @@ -117,4 +107,20 @@ private function replaceNameVariable(string $rectorName, string $contents): stri { return str_replace('__Name__', $rectorName, $contents); } + + private function askMutatorName(IO $io): mixed + { + $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); + $question->setValidator(static function (?string $answer): string { + if ($answer === null || trim($answer) === '') { + throw new RuntimeException('Mutator name is mandatory.'); + } + + return $answer; + }); + + return $io->askQuestion( + $question, + ); + } } From 0c63af7efffc9e114c4bfadaeef829f81678a090 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 12:56:37 +0200 Subject: [PATCH 10/25] Use hardcoded paths instead of Finder --- src/Command/CustomMutatorCommand.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 2a65579bfc..caf20e01d1 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -35,15 +35,15 @@ namespace Infection\Command; +use function basename; +use function file_get_contents; use Infection\Console\IO; -use function iterator_to_array; use RuntimeException; use function Safe\getcwd; use function sprintf; use function str_replace; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Question\Question; -use Symfony\Component\Finder\Finder; use function trim; use function ucfirst; @@ -70,22 +70,20 @@ protected function executeCommand(IO $io): bool $mutatorName = ucfirst((string) $mutatorName); - // find all files in templates directory - $finder = Finder::create() - ->files() - ->in(__DIR__ . '/../CustomMutator/templates'); + $filePaths = [ + __DIR__ . '/../CustomMutator/templates/__Name__.php', + __DIR__ . '/../CustomMutator/templates/__Name__Test.php', + ]; $currentDirectory = getcwd(); - $generatedFilePaths = []; - $fileInfos = iterator_to_array($finder->getIterator()); $fileSystem = $this->getApplication()->getContainer()->getFileSystem(); - foreach ($fileInfos as $fileInfo) { + foreach ($filePaths as $filePath) { // replace __Name__ with $mutator - $newContent = $this->replaceNameVariable($mutatorName, $fileInfo->getContents()); - $replacedNamePath = $this->replaceNameVariable($mutatorName, $fileInfo->getRelativePathname()); + $newContent = $this->replaceNameVariable($mutatorName, file_get_contents($filePath)); + $replacedNamePath = $this->replaceNameVariable($mutatorName, basename($filePath)); $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; From 7dd741921a0e17a4251378d050046a0d1a8f30ab Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:01:22 +0200 Subject: [PATCH 11/25] Use static methods --- src/Command/CustomMutatorCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index caf20e01d1..18f43efcad 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -81,9 +81,9 @@ protected function executeCommand(IO $io): bool $fileSystem = $this->getApplication()->getContainer()->getFileSystem(); foreach ($filePaths as $filePath) { - // replace __Name__ with $mutator - $newContent = $this->replaceNameVariable($mutatorName, file_get_contents($filePath)); - $replacedNamePath = $this->replaceNameVariable($mutatorName, basename($filePath)); + // replace __Name__ with $mutatorName + $newContent = self::replaceNameVariable($mutatorName, file_get_contents($filePath)); + $replacedNamePath = self::replaceNameVariable($mutatorName, basename($filePath)); $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; @@ -101,7 +101,7 @@ protected function executeCommand(IO $io): bool return true; } - private function replaceNameVariable(string $rectorName, string $contents): string + private static function replaceNameVariable(string $rectorName, string $contents): string { return str_replace('__Name__', $rectorName, $contents); } From 969cd704dcd5b0abdcbbbb974a4ed7e70ca41879 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:04:43 +0200 Subject: [PATCH 12/25] Create helper method to dump templates to project to improve readability --- src/Command/CustomMutatorCommand.php | 45 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 18f43efcad..d5060bf723 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -70,27 +70,12 @@ protected function executeCommand(IO $io): bool $mutatorName = ucfirst((string) $mutatorName); - $filePaths = [ + $templateFilePaths = [ __DIR__ . '/../CustomMutator/templates/__Name__.php', __DIR__ . '/../CustomMutator/templates/__Name__Test.php', ]; - $currentDirectory = getcwd(); - $generatedFilePaths = []; - - $fileSystem = $this->getApplication()->getContainer()->getFileSystem(); - - foreach ($filePaths as $filePath) { - // replace __Name__ with $mutatorName - $newContent = self::replaceNameVariable($mutatorName, file_get_contents($filePath)); - $replacedNamePath = self::replaceNameVariable($mutatorName, basename($filePath)); - - $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; - - $fileSystem->dumpFile($newFilePath, $newContent); - - $generatedFilePaths[] = $newFilePath; - } + $generatedFilePaths = $this->createProjectFilesFromTemplates($templateFilePaths, $mutatorName); $io->title('Generated files'); $io->listing($generatedFilePaths); @@ -121,4 +106,30 @@ private function askMutatorName(IO $io): mixed $question, ); } + + /** + * @param list $filePaths + * @return list + */ + private function createProjectFilesFromTemplates(array $filePaths, string $mutatorName): array + { + $currentDirectory = getcwd(); + $generatedFilePaths = []; + + $fileSystem = $this->getApplication()->getContainer()->getFileSystem(); + + foreach ($filePaths as $filePath) { + // replace __Name__ with $mutatorName + $newContent = self::replaceNameVariable($mutatorName, file_get_contents($filePath)); + $replacedNamePath = self::replaceNameVariable($mutatorName, basename($filePath)); + + $newFilePath = $currentDirectory . '/src/Mutator/' . $replacedNamePath; + + $fileSystem->dumpFile($newFilePath, $newContent); + + $generatedFilePaths[] = $newFilePath; + } + + return $generatedFilePaths; + } } From 39c46a2759ab64b2c3b4df63189ab0813cb13820 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:05:04 +0200 Subject: [PATCH 13/25] Fix type --- src/Command/CustomMutatorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index d5060bf723..7f6101a418 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -80,7 +80,7 @@ protected function executeCommand(IO $io): bool $io->title('Generated files'); $io->listing($generatedFilePaths); $io->success( - sprintf('Base classes for the "%s" mutator were created. Complee the missing parts inside them.', $mutatorName), + sprintf('Base classes for the "%s" mutator were created. Complete the missing parts inside them.', $mutatorName), ); return true; From 317bd3d3b95d2f945037fa62f08f19a154d5086f Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:05:40 +0200 Subject: [PATCH 14/25] Reword info message --- src/Command/CustomMutatorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 7f6101a418..98196bbb1f 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -80,7 +80,7 @@ protected function executeCommand(IO $io): bool $io->title('Generated files'); $io->listing($generatedFilePaths); $io->success( - sprintf('Base classes for the "%s" mutator were created. Complete the missing parts inside them.', $mutatorName), + sprintf('Base classes for the mutator "%s" were created. Complete the missing parts inside them.', $mutatorName), ); return true; From 9a974618671641717e97c9e658268c8a773898ac Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:07:22 +0200 Subject: [PATCH 15/25] Move `getDefinition()` to the top of the mutator class --- src/CustomMutator/templates/__Name__.php | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/CustomMutator/templates/__Name__.php b/src/CustomMutator/templates/__Name__.php index 2b6ff49f31..fba35de265 100644 --- a/src/CustomMutator/templates/__Name__.php +++ b/src/CustomMutator/templates/__Name__.php @@ -41,6 +41,22 @@ class __Name__ implements Mutator { + public static function getDefinition(): Definition + { + return new Definition( + <<<'TXT' + TODO: add description of this mutator here + TXT + , + MutatorCategory::ORTHOGONAL_REPLACEMENT, + null, + <<<'DIFF' + - TODO: show the source code before mutation + + TODO: show the source code after mutation + DIFF, + ); + } + public function canMutate(Node $node): bool { // TODO: update the logic to decide if this mutator can mutate $node @@ -58,22 +74,6 @@ public function mutate(Node $node): iterable yield $node; } - public static function getDefinition(): Definition - { - return new Definition( - <<<'TXT' - TODO: add description of this mutator here - TXT - , - MutatorCategory::ORTHOGONAL_REPLACEMENT, - null, - <<<'DIFF' - - TODO: show the source code before mutation - + TODO: show the source code after mutation - DIFF, - ); - } - public function getName(): string { return self::class; From f5d986d5ba18e14e35914a8d8c526ac72c8941b8 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:08:49 +0200 Subject: [PATCH 16/25] Inline `Mutator` property type --- src/Testing/BaseMutatorTestCase.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Testing/BaseMutatorTestCase.php b/src/Testing/BaseMutatorTestCase.php index 0df996d3aa..9d1a8bbe6d 100644 --- a/src/Testing/BaseMutatorTestCase.php +++ b/src/Testing/BaseMutatorTestCase.php @@ -55,10 +55,7 @@ abstract class BaseMutatorTestCase extends TestCase { - /** - * @var Mutator - */ - protected $mutator; + protected Mutator $mutator; protected function setUp(): void { From 30f6764d17feae59cf6dc68dca9c906c3ceffb65 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:19:26 +0200 Subject: [PATCH 17/25] Rename base test method --- src/CustomMutator/templates/__Name__Test.php | 2 +- src/Testing/BaseMutatorTestCase.php | 4 ++-- tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/AssignmentTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/DecrementTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/DivEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/DivisionTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/IncrementTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/MinusTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/ModEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/ModulusTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/MulEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/PlusTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/PowEqualTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php | 2 +- tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php | 2 +- tests/phpunit/Mutator/Boolean/ArrayItemTest.php | 2 +- tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php | 2 +- tests/phpunit/Mutator/Boolean/FalseValueTest.php | 2 +- tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php | 2 +- tests/phpunit/Mutator/Boolean/InstanceOf_Test.php | 2 +- .../Mutator/Boolean/LogicalAndAllSubExprNegationTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php | 2 +- .../Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalAndTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalNotTest.php | 2 +- .../Mutator/Boolean/LogicalOrAllSubExprNegationTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php | 2 +- .../Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php | 2 +- tests/phpunit/Mutator/Boolean/LogicalOrTest.php | 2 +- tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php | 2 +- tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php | 2 +- tests/phpunit/Mutator/Boolean/TrueValueTest.php | 2 +- tests/phpunit/Mutator/Boolean/Yield_Test.php | 2 +- tests/phpunit/Mutator/Cast/CastArrayTest.php | 2 +- tests/phpunit/Mutator/Cast/CastBoolTest.php | 2 +- tests/phpunit/Mutator/Cast/CastFloatTest.php | 2 +- tests/phpunit/Mutator/Cast/CastIntTest.php | 2 +- tests/phpunit/Mutator/Cast/CastObjectTest.php | 2 +- tests/phpunit/Mutator/Cast/CastStringTest.php | 2 +- .../Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php | 2 +- tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php | 2 +- .../Mutator/ConditionalBoundary/LessThanOrEqualToTest.php | 2 +- tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php | 2 +- tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php | 2 +- .../ConditionalNegotiation/GreaterThanNegotiationTest.php | 2 +- .../GreaterThanOrEqualToNegotiationTest.php | 2 +- .../phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php | 2 +- .../ConditionalNegotiation/LessThanNegotiationTest.php | 2 +- .../LessThanOrEqualToNegotiationTest.php | 2 +- tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php | 2 +- .../Mutator/ConditionalNegotiation/NotIdenticalTest.php | 2 +- tests/phpunit/Mutator/Extensions/BCMathTest.php | 2 +- tests/phpunit/Mutator/Extensions/MBStringTest.php | 2 +- .../Mutator/FunctionSignature/ProtectedVisibilityTest.php | 2 +- .../Mutator/FunctionSignature/PublicVisibilityTest.php | 4 ++-- tests/phpunit/Mutator/Loop/DoWhileTest.php | 2 +- tests/phpunit/Mutator/Loop/For_Test.php | 2 +- tests/phpunit/Mutator/Loop/Foreach_Test.php | 2 +- tests/phpunit/Mutator/Loop/While_Test.php | 2 +- tests/phpunit/Mutator/Number/DecrementIntegerTest.php | 2 +- tests/phpunit/Mutator/Number/IncrementIntegerTest.php | 2 +- tests/phpunit/Mutator/Number/OneZeroFloatTest.php | 2 +- tests/phpunit/Mutator/Operator/AssignCoalesceTest.php | 2 +- tests/phpunit/Mutator/Operator/Break_Test.php | 2 +- tests/phpunit/Mutator/Operator/Catch_Test.php | 2 +- tests/phpunit/Mutator/Operator/CoalesceTest.php | 2 +- tests/phpunit/Mutator/Operator/ConcatTest.php | 2 +- tests/phpunit/Mutator/Operator/Continue_Test.php | 2 +- tests/phpunit/Mutator/Operator/ElseIfNegationTest.php | 2 +- tests/phpunit/Mutator/Operator/Finally_Test.php | 2 +- tests/phpunit/Mutator/Operator/IfNegationTest.php | 2 +- tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php | 2 +- tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php | 2 +- tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php | 2 +- tests/phpunit/Mutator/Operator/SpreadOneItemTest.php | 2 +- tests/phpunit/Mutator/Operator/SpreadRemovalTest.php | 2 +- tests/phpunit/Mutator/Operator/TernaryTest.php | 2 +- tests/phpunit/Mutator/Operator/Throw_Test.php | 2 +- tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php | 2 +- tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php | 2 +- tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php | 2 +- tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php | 2 +- tests/phpunit/Mutator/Regex/PregQuoteTest.php | 2 +- tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/CloneRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php | 2 +- tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/NewObjectTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/ThisTest.php | 2 +- tests/phpunit/Mutator/ReturnValue/YieldValueTest.php | 2 +- tests/phpunit/Mutator/Sort/SpaceshipTest.php | 2 +- tests/phpunit/Mutator/SyntaxErrorTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php | 2 +- .../phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php | 2 +- .../phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php | 2 +- .../phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php | 2 +- .../phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php | 2 +- .../Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php | 2 +- tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php | 2 +- 162 files changed, 164 insertions(+), 164 deletions(-) diff --git a/src/CustomMutator/templates/__Name__Test.php b/src/CustomMutator/templates/__Name__Test.php index 01adbfaef3..f50f34323f 100644 --- a/src/CustomMutator/templates/__Name__Test.php +++ b/src/CustomMutator/templates/__Name__Test.php @@ -49,7 +49,7 @@ final class __Name__Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/src/Testing/BaseMutatorTestCase.php b/src/Testing/BaseMutatorTestCase.php index 9d1a8bbe6d..3ee07a9a7c 100644 --- a/src/Testing/BaseMutatorTestCase.php +++ b/src/Testing/BaseMutatorTestCase.php @@ -64,10 +64,10 @@ protected function setUp(): void } /** - * @param string|string[] $expectedCode + * @param string|string[]|null $expectedCode * @param mixed[] $settings */ - final public function doTest(string $inputCode, $expectedCode = [], array $settings = [], bool $allowInvalidCode = false): void + final protected function assertMutatesInput(string $inputCode, string|array|null $expectedCode = [], array $settings = [], bool $allowInvalidCode = false): void { $expectedCodeSamples = (array) $expectedCode; diff --git a/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php b/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php index aee74901f6..abe9aac25f 100644 --- a/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/AssignmentEqualTest.php @@ -49,7 +49,7 @@ final class AssignmentEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php b/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php index 94f7fde654..7be8c7f946 100644 --- a/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php +++ b/tests/phpunit/Mutator/Arithmetic/AssignmentTest.php @@ -49,7 +49,7 @@ final class AssignmentTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php index ece328c4d9..ed3e056661 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseAndTest.php @@ -49,7 +49,7 @@ final class BitwiseAndTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php index df256195f2..9d37e88b99 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseNotTest.php @@ -49,7 +49,7 @@ final class BitwiseNotTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php index 68d53d4b90..ed07991351 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseOrTest.php @@ -49,7 +49,7 @@ final class BitwiseOrTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php b/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php index 83ae63a3ba..f4c90bb099 100644 --- a/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php +++ b/tests/phpunit/Mutator/Arithmetic/BitwiseXorTest.php @@ -49,7 +49,7 @@ final class BitwiseXorTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/DecrementTest.php b/tests/phpunit/Mutator/Arithmetic/DecrementTest.php index 3ae82b3b5e..e31ee1fe62 100644 --- a/tests/phpunit/Mutator/Arithmetic/DecrementTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DecrementTest.php @@ -49,7 +49,7 @@ final class DecrementTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php b/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php index b087b68968..598d0519dc 100644 --- a/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DivEqualTest.php @@ -49,7 +49,7 @@ final class DivEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/DivisionTest.php b/tests/phpunit/Mutator/Arithmetic/DivisionTest.php index 7f79841636..b2e52e407b 100644 --- a/tests/phpunit/Mutator/Arithmetic/DivisionTest.php +++ b/tests/phpunit/Mutator/Arithmetic/DivisionTest.php @@ -49,7 +49,7 @@ final class DivisionTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php b/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php index 60b918982c..86d6b85ebb 100644 --- a/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ExponentiationTest.php @@ -49,7 +49,7 @@ final class ExponentiationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/IncrementTest.php b/tests/phpunit/Mutator/Arithmetic/IncrementTest.php index 7edd6e9a6f..166b05ccfe 100644 --- a/tests/phpunit/Mutator/Arithmetic/IncrementTest.php +++ b/tests/phpunit/Mutator/Arithmetic/IncrementTest.php @@ -49,7 +49,7 @@ final class IncrementTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php b/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php index 6c1eb79890..fc52809c4c 100644 --- a/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MinusEqualTest.php @@ -49,7 +49,7 @@ final class MinusEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/MinusTest.php b/tests/phpunit/Mutator/Arithmetic/MinusTest.php index ed0929cb6e..c1f2576ebf 100644 --- a/tests/phpunit/Mutator/Arithmetic/MinusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MinusTest.php @@ -49,7 +49,7 @@ final class MinusTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php b/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php index 7f072e0ac7..5932063bdd 100644 --- a/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ModEqualTest.php @@ -49,7 +49,7 @@ final class ModEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/ModulusTest.php b/tests/phpunit/Mutator/Arithmetic/ModulusTest.php index f6f5de6ddb..a6ef62754c 100644 --- a/tests/phpunit/Mutator/Arithmetic/ModulusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ModulusTest.php @@ -49,7 +49,7 @@ final class ModulusTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php b/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php index 99aefa4b59..481529cfd6 100644 --- a/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MulEqualTest.php @@ -49,7 +49,7 @@ final class MulEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php b/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php index d5e75654c5..f5429c61bc 100644 --- a/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php +++ b/tests/phpunit/Mutator/Arithmetic/MultiplicationTest.php @@ -49,7 +49,7 @@ final class MultiplicationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php b/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php index ee394aacf3..b931b5864a 100644 --- a/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PlusEqualTest.php @@ -49,7 +49,7 @@ final class PlusEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/PlusTest.php b/tests/phpunit/Mutator/Arithmetic/PlusTest.php index 2b79391178..1176aa1ecc 100644 --- a/tests/phpunit/Mutator/Arithmetic/PlusTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PlusTest.php @@ -52,7 +52,7 @@ final class PlusTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php b/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php index b10283ff9f..46c0c542e0 100644 --- a/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php +++ b/tests/phpunit/Mutator/Arithmetic/PowEqualTest.php @@ -49,7 +49,7 @@ final class PowEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php b/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php index 99eaa74b02..31f8045866 100644 --- a/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php +++ b/tests/phpunit/Mutator/Arithmetic/RoundingFamilyTest.php @@ -49,7 +49,7 @@ final class RoundingFamilyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php b/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php index 302031a43e..ff06fff410 100644 --- a/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ShiftLeftTest.php @@ -49,7 +49,7 @@ final class ShiftLeftTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php b/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php index be973d7e95..b356da1e3c 100644 --- a/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php +++ b/tests/phpunit/Mutator/Arithmetic/ShiftRightTest.php @@ -49,7 +49,7 @@ final class ShiftRightTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/ArrayItemTest.php b/tests/phpunit/Mutator/Boolean/ArrayItemTest.php index 418939ee90..8fbdf5e4ee 100644 --- a/tests/phpunit/Mutator/Boolean/ArrayItemTest.php +++ b/tests/phpunit/Mutator/Boolean/ArrayItemTest.php @@ -49,7 +49,7 @@ final class ArrayItemTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php b/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php index 1c796f8417..864f86c3c4 100644 --- a/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php +++ b/tests/phpunit/Mutator/Boolean/EqualIdenticalTest.php @@ -49,7 +49,7 @@ final class EqualIdenticalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/FalseValueTest.php b/tests/phpunit/Mutator/Boolean/FalseValueTest.php index 51169caa3f..ba251fed7a 100644 --- a/tests/phpunit/Mutator/Boolean/FalseValueTest.php +++ b/tests/phpunit/Mutator/Boolean/FalseValueTest.php @@ -51,7 +51,7 @@ final class FalseValueTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php b/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php index 892f1d9a64..1d203e735a 100644 --- a/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php +++ b/tests/phpunit/Mutator/Boolean/IdenticalEqualTest.php @@ -49,7 +49,7 @@ final class IdenticalEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php b/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php index 2947e47914..de128ac1de 100644 --- a/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php +++ b/tests/phpunit/Mutator/Boolean/InstanceOf_Test.php @@ -49,7 +49,7 @@ final class InstanceOf_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php index d94b94c248..b05964df26 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndAllSubExprNegationTest.php @@ -49,7 +49,7 @@ final class LogicalAndAllSubExprNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php index d6f59c6704..07a5c4a632 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndNegationTest.php @@ -49,7 +49,7 @@ final class LogicalAndNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php index 9ddc94af87..bbbf070d4d 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndSingleSubExprNegationTest.php @@ -49,7 +49,7 @@ final class LogicalAndSingleSubExprNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalAndTest.php b/tests/phpunit/Mutator/Boolean/LogicalAndTest.php index 40e3e9397e..169ad96f02 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalAndTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalAndTest.php @@ -49,7 +49,7 @@ final class LogicalAndTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php b/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php index d9ed19bdb6..d1ad938e16 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalLowerAndTest.php @@ -49,7 +49,7 @@ final class LogicalLowerAndTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php b/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php index 58b0f32b92..815d4e6ed8 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalLowerOrTest.php @@ -49,7 +49,7 @@ final class LogicalLowerOrTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalNotTest.php b/tests/phpunit/Mutator/Boolean/LogicalNotTest.php index ae84566a0b..92c66c57f8 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalNotTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalNotTest.php @@ -52,7 +52,7 @@ final class LogicalNotTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php index 5c6b35884d..93dc9f4a7c 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrAllSubExprNegationTest.php @@ -49,7 +49,7 @@ final class LogicalOrAllSubExprNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php index cbc9cf913a..8d86e60047 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrNegationTest.php @@ -49,7 +49,7 @@ final class LogicalOrNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php index 9672ce415a..51f5ec4075 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrSingleSubExprNegationTest.php @@ -49,7 +49,7 @@ final class LogicalOrSingleSubExprNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/LogicalOrTest.php b/tests/phpunit/Mutator/Boolean/LogicalOrTest.php index 92ca2ed646..3ee686f146 100644 --- a/tests/phpunit/Mutator/Boolean/LogicalOrTest.php +++ b/tests/phpunit/Mutator/Boolean/LogicalOrTest.php @@ -49,7 +49,7 @@ final class LogicalOrTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php b/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php index b120b270b9..296062a634 100644 --- a/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php +++ b/tests/phpunit/Mutator/Boolean/NotEqualNotIdenticalTest.php @@ -49,7 +49,7 @@ final class NotEqualNotIdenticalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php b/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php index bc6d337a90..f45e4264aa 100644 --- a/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php +++ b/tests/phpunit/Mutator/Boolean/NotIdenticalNotEqualTest.php @@ -49,7 +49,7 @@ final class NotIdenticalNotEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/TrueValueTest.php b/tests/phpunit/Mutator/Boolean/TrueValueTest.php index 20ebe5f031..e0e83af931 100644 --- a/tests/phpunit/Mutator/Boolean/TrueValueTest.php +++ b/tests/phpunit/Mutator/Boolean/TrueValueTest.php @@ -52,7 +52,7 @@ final class TrueValueTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate($input, $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Boolean/Yield_Test.php b/tests/phpunit/Mutator/Boolean/Yield_Test.php index 140736ab3c..8d3ec7eb5a 100644 --- a/tests/phpunit/Mutator/Boolean/Yield_Test.php +++ b/tests/phpunit/Mutator/Boolean/Yield_Test.php @@ -49,7 +49,7 @@ final class Yield_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastArrayTest.php b/tests/phpunit/Mutator/Cast/CastArrayTest.php index d3578694e6..60c8eca1de 100644 --- a/tests/phpunit/Mutator/Cast/CastArrayTest.php +++ b/tests/phpunit/Mutator/Cast/CastArrayTest.php @@ -49,7 +49,7 @@ final class CastArrayTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastBoolTest.php b/tests/phpunit/Mutator/Cast/CastBoolTest.php index 6724993e4f..f326e263f9 100644 --- a/tests/phpunit/Mutator/Cast/CastBoolTest.php +++ b/tests/phpunit/Mutator/Cast/CastBoolTest.php @@ -49,7 +49,7 @@ final class CastBoolTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastFloatTest.php b/tests/phpunit/Mutator/Cast/CastFloatTest.php index 1906d59b61..73a5d31d4b 100644 --- a/tests/phpunit/Mutator/Cast/CastFloatTest.php +++ b/tests/phpunit/Mutator/Cast/CastFloatTest.php @@ -49,7 +49,7 @@ final class CastFloatTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastIntTest.php b/tests/phpunit/Mutator/Cast/CastIntTest.php index 257c0893f1..21061b21b1 100644 --- a/tests/phpunit/Mutator/Cast/CastIntTest.php +++ b/tests/phpunit/Mutator/Cast/CastIntTest.php @@ -49,7 +49,7 @@ final class CastIntTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastObjectTest.php b/tests/phpunit/Mutator/Cast/CastObjectTest.php index 1fbd0b4d09..d00a0d7684 100644 --- a/tests/phpunit/Mutator/Cast/CastObjectTest.php +++ b/tests/phpunit/Mutator/Cast/CastObjectTest.php @@ -49,7 +49,7 @@ final class CastObjectTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Cast/CastStringTest.php b/tests/phpunit/Mutator/Cast/CastStringTest.php index 5b89a97415..ad9f9c3dcf 100644 --- a/tests/phpunit/Mutator/Cast/CastStringTest.php +++ b/tests/phpunit/Mutator/Cast/CastStringTest.php @@ -49,7 +49,7 @@ final class CastStringTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php index 3a739ef020..79a86be030 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanOrEqualToTest.php @@ -49,7 +49,7 @@ final class GreaterThanOrEqualToTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php index ef216d959d..1c948a7b20 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/GreaterThanTest.php @@ -49,7 +49,7 @@ final class GreaterThanTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php b/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php index 5f73ea79a2..dbac6af532 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/LessThanOrEqualToTest.php @@ -49,7 +49,7 @@ final class LessThanOrEqualToTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php b/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php index 95ab1d852a..3e5f98ba3a 100644 --- a/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php +++ b/tests/phpunit/Mutator/ConditionalBoundary/LessThanTest.php @@ -49,7 +49,7 @@ final class LessThanTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php index d2fd6625d5..508a194de8 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/EqualTest.php @@ -49,7 +49,7 @@ final class EqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php index b6cb00e3e2..9298e71e07 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanNegotiationTest.php @@ -49,7 +49,7 @@ final class GreaterThanNegotiationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php index 234958a00f..3bfd2270f8 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/GreaterThanOrEqualToNegotiationTest.php @@ -49,7 +49,7 @@ final class GreaterThanOrEqualToNegotiationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php index de9b29a001..fec42b7bc2 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/IdenticalTest.php @@ -49,7 +49,7 @@ final class IdenticalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php index 59ef525b38..06c42f8bba 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanNegotiationTest.php @@ -49,7 +49,7 @@ final class LessThanNegotiationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php index dd2412bb19..089dc3858a 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/LessThanOrEqualToNegotiationTest.php @@ -49,7 +49,7 @@ final class LessThanOrEqualToNegotiationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php index 36baa5d3c6..069b219baf 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/NotEqualTest.php @@ -49,7 +49,7 @@ final class NotEqualTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php b/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php index 4915983336..10f0ba737c 100644 --- a/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php +++ b/tests/phpunit/Mutator/ConditionalNegotiation/NotIdenticalTest.php @@ -49,7 +49,7 @@ final class NotIdenticalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Extensions/BCMathTest.php b/tests/phpunit/Mutator/Extensions/BCMathTest.php index 47389eb49b..62db652d53 100644 --- a/tests/phpunit/Mutator/Extensions/BCMathTest.php +++ b/tests/phpunit/Mutator/Extensions/BCMathTest.php @@ -54,7 +54,7 @@ final class BCMathTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Extensions/MBStringTest.php b/tests/phpunit/Mutator/Extensions/MBStringTest.php index a18fd26210..51704908e8 100644 --- a/tests/phpunit/Mutator/Extensions/MBStringTest.php +++ b/tests/phpunit/Mutator/Extensions/MBStringTest.php @@ -56,7 +56,7 @@ public static function setUpBeforeClass(): void #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php b/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php index 5a7d530079..967afa8b46 100644 --- a/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php +++ b/tests/phpunit/Mutator/FunctionSignature/ProtectedVisibilityTest.php @@ -52,7 +52,7 @@ final class ProtectedVisibilityTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php b/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php index 3ceeb47173..bbc239312f 100644 --- a/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php +++ b/tests/phpunit/Mutator/FunctionSignature/PublicVisibilityTest.php @@ -51,7 +51,7 @@ public function test_it_does_not_modify_blacklisted_functions(string $functionNa { $code = MutatorFixturesProvider::getFixtureFileContent(self::class, "pv-{$functionName}.php"); - $this->doTest($code); + $this->assertMutatesInput($code); } public static function blacklistedProvider(): array @@ -76,7 +76,7 @@ public static function blacklistedProvider(): array #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Loop/DoWhileTest.php b/tests/phpunit/Mutator/Loop/DoWhileTest.php index e8aa75116e..e7e14d2931 100644 --- a/tests/phpunit/Mutator/Loop/DoWhileTest.php +++ b/tests/phpunit/Mutator/Loop/DoWhileTest.php @@ -49,7 +49,7 @@ final class DoWhileTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Loop/For_Test.php b/tests/phpunit/Mutator/Loop/For_Test.php index d102a2f2dd..b15c97d501 100644 --- a/tests/phpunit/Mutator/Loop/For_Test.php +++ b/tests/phpunit/Mutator/Loop/For_Test.php @@ -49,7 +49,7 @@ final class For_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Loop/Foreach_Test.php b/tests/phpunit/Mutator/Loop/Foreach_Test.php index ac6954b563..7ffc4b9968 100644 --- a/tests/phpunit/Mutator/Loop/Foreach_Test.php +++ b/tests/phpunit/Mutator/Loop/Foreach_Test.php @@ -49,7 +49,7 @@ final class Foreach_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Loop/While_Test.php b/tests/phpunit/Mutator/Loop/While_Test.php index a09b39fd01..d904245d35 100644 --- a/tests/phpunit/Mutator/Loop/While_Test.php +++ b/tests/phpunit/Mutator/Loop/While_Test.php @@ -49,7 +49,7 @@ final class While_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php index f83f455447..60fde63e88 100644 --- a/tests/phpunit/Mutator/Number/DecrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/DecrementIntegerTest.php @@ -51,7 +51,7 @@ final class DecrementIntegerTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php index a64709bf04..c4f46a761b 100644 --- a/tests/phpunit/Mutator/Number/IncrementIntegerTest.php +++ b/tests/phpunit/Mutator/Number/IncrementIntegerTest.php @@ -51,7 +51,7 @@ final class IncrementIntegerTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Number/OneZeroFloatTest.php b/tests/phpunit/Mutator/Number/OneZeroFloatTest.php index 623d961c48..e043a4ada3 100644 --- a/tests/phpunit/Mutator/Number/OneZeroFloatTest.php +++ b/tests/phpunit/Mutator/Number/OneZeroFloatTest.php @@ -49,7 +49,7 @@ final class OneZeroFloatTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php b/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php index 96e35b72d4..a02f38f649 100644 --- a/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php +++ b/tests/phpunit/Mutator/Operator/AssignCoalesceTest.php @@ -49,7 +49,7 @@ final class AssignCoalesceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/Break_Test.php b/tests/phpunit/Mutator/Operator/Break_Test.php index 38f09c8d54..d8c928e098 100644 --- a/tests/phpunit/Mutator/Operator/Break_Test.php +++ b/tests/phpunit/Mutator/Operator/Break_Test.php @@ -49,7 +49,7 @@ final class Break_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/Catch_Test.php b/tests/phpunit/Mutator/Operator/Catch_Test.php index 91cbb533c8..2ddb9b8e6f 100644 --- a/tests/phpunit/Mutator/Operator/Catch_Test.php +++ b/tests/phpunit/Mutator/Operator/Catch_Test.php @@ -49,7 +49,7 @@ final class Catch_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, array|string $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/CoalesceTest.php b/tests/phpunit/Mutator/Operator/CoalesceTest.php index 28573a128d..b649748bf0 100644 --- a/tests/phpunit/Mutator/Operator/CoalesceTest.php +++ b/tests/phpunit/Mutator/Operator/CoalesceTest.php @@ -49,7 +49,7 @@ final class CoalesceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/ConcatTest.php b/tests/phpunit/Mutator/Operator/ConcatTest.php index bf1f759db6..cf48602ec2 100644 --- a/tests/phpunit/Mutator/Operator/ConcatTest.php +++ b/tests/phpunit/Mutator/Operator/ConcatTest.php @@ -49,7 +49,7 @@ final class ConcatTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/Continue_Test.php b/tests/phpunit/Mutator/Operator/Continue_Test.php index 2c61c9b004..b50f430ce6 100644 --- a/tests/phpunit/Mutator/Operator/Continue_Test.php +++ b/tests/phpunit/Mutator/Operator/Continue_Test.php @@ -49,7 +49,7 @@ final class Continue_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php b/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php index 61ea6eecfa..04329c21fd 100644 --- a/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php +++ b/tests/phpunit/Mutator/Operator/ElseIfNegationTest.php @@ -49,7 +49,7 @@ final class ElseIfNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/Finally_Test.php b/tests/phpunit/Mutator/Operator/Finally_Test.php index 0bff1045ad..cd827e51c8 100644 --- a/tests/phpunit/Mutator/Operator/Finally_Test.php +++ b/tests/phpunit/Mutator/Operator/Finally_Test.php @@ -49,7 +49,7 @@ final class Finally_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/IfNegationTest.php b/tests/phpunit/Mutator/Operator/IfNegationTest.php index 12e84cab23..b6d7f81064 100644 --- a/tests/phpunit/Mutator/Operator/IfNegationTest.php +++ b/tests/phpunit/Mutator/Operator/IfNegationTest.php @@ -49,7 +49,7 @@ final class IfNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php index e265c7e96e..3dffbc2d8c 100644 --- a/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafeMethodCallTest.php @@ -54,7 +54,7 @@ public function test_it_can_mutate(string $input, $expected = []): void $this->markTestSkipped('Null Safe operator is available only in PHP 8 or higher'); } - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php index ac76cd0db7..f6c9e36aa3 100644 --- a/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php +++ b/tests/phpunit/Mutator/Operator/NullSafePropertyCallTest.php @@ -54,7 +54,7 @@ public function test_it_can_mutate(string $input, $expected = []): void $this->markTestSkipped('Null Safe operator is available only in PHP 8 or higher'); } - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php b/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php index cf6f793595..8dcaead761 100644 --- a/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadAssignmentTest.php @@ -49,7 +49,7 @@ final class SpreadAssignmentTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php b/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php index 0f34a68f1d..203880ee26 100644 --- a/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadOneItemTest.php @@ -49,7 +49,7 @@ final class SpreadOneItemTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php b/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php index 2a83c13777..bff85b7ce8 100644 --- a/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php +++ b/tests/phpunit/Mutator/Operator/SpreadRemovalTest.php @@ -49,7 +49,7 @@ final class SpreadRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/TernaryTest.php b/tests/phpunit/Mutator/Operator/TernaryTest.php index d86d532646..68188daa9a 100644 --- a/tests/phpunit/Mutator/Operator/TernaryTest.php +++ b/tests/phpunit/Mutator/Operator/TernaryTest.php @@ -50,7 +50,7 @@ final class TernaryTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Operator/Throw_Test.php b/tests/phpunit/Mutator/Operator/Throw_Test.php index d97d7c82ee..9b1b6f3d03 100644 --- a/tests/phpunit/Mutator/Operator/Throw_Test.php +++ b/tests/phpunit/Mutator/Operator/Throw_Test.php @@ -49,7 +49,7 @@ final class Throw_Test extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php b/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php index 47ce72a565..8b46b94b7c 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchMatchesTest.php @@ -49,7 +49,7 @@ final class PregMatchMatchesTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $output = []): void { - $this->doTest($input, $output); + $this->assertMutatesInput($input, $output); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php index f571362049..01f73248a3 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveCaretTest.php @@ -50,7 +50,7 @@ final class PregMatchRemoveCaretTest extends BaseMutatorTestCase #[DataProvider('provideMutationCases')] public function test_mutator($input, $expected = null): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function provideMutationCases(): Generator diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php index 21697b77fb..bec46f89c6 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveDollarTest.php @@ -50,7 +50,7 @@ final class PregMatchRemoveDollarTest extends BaseMutatorTestCase #[DataProvider('provideMutationCases')] public function test_mutator($input, $expected = null): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function provideMutationCases(): Generator diff --git a/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php b/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php index 40328075ac..d58a67d203 100644 --- a/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php +++ b/tests/phpunit/Mutator/Regex/PregMatchRemoveFlagsTest.php @@ -50,7 +50,7 @@ final class PregMatchRemoveFlagsTest extends BaseMutatorTestCase #[DataProvider('provideMutationCases')] public function test_mutator($input, $expected = null): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function provideMutationCases(): Generator diff --git a/tests/phpunit/Mutator/Regex/PregQuoteTest.php b/tests/phpunit/Mutator/Regex/PregQuoteTest.php index 3cd28422a1..81ccdbfbbd 100644 --- a/tests/phpunit/Mutator/Regex/PregQuoteTest.php +++ b/tests/phpunit/Mutator/Regex/PregQuoteTest.php @@ -49,7 +49,7 @@ final class PregQuoteTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php b/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php index 5bea76ca23..bbf6f06916 100644 --- a/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/ArrayItemRemovalTest.php @@ -53,7 +53,7 @@ final class ArrayItemRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php b/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php index 13fd2a532f..fc6614de99 100644 --- a/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/CatchBlockRemovalTest.php @@ -49,7 +49,7 @@ final class CatchBlockRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, array|string $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/CloneRemovalTest.php b/tests/phpunit/Mutator/Removal/CloneRemovalTest.php index bc2514b99e..5ee70b7177 100644 --- a/tests/phpunit/Mutator/Removal/CloneRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/CloneRemovalTest.php @@ -49,7 +49,7 @@ final class CloneRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php b/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php index 03370d3659..1822c8ae3e 100644 --- a/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/ConcatOperandRemovalTest.php @@ -49,7 +49,7 @@ final class ConcatOperandRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php b/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php index fb6f0d1abf..bb3dac5232 100644 --- a/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/FunctionCallRemovalTest.php @@ -49,7 +49,7 @@ final class FunctionCallRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php b/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php index 5eeb3757bf..50970c47d0 100644 --- a/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/MatchArmRemovalTest.php @@ -49,7 +49,7 @@ final class MatchArmRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, array|string $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php b/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php index 83a9c4b84e..128f8ba6f4 100644 --- a/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/MethodCallRemovalTest.php @@ -49,7 +49,7 @@ final class MethodCallRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php b/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php index da8987d9a7..eb44db8155 100644 --- a/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php +++ b/tests/phpunit/Mutator/Removal/SharedCaseRemovalTest.php @@ -50,7 +50,7 @@ final class SharedCaseRemovalTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php b/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php index 2abd79db4d..26b2eeac6f 100644 --- a/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php +++ b/tests/phpunit/Mutator/ReturnValue/ArrayOneItemTest.php @@ -52,7 +52,7 @@ final class ArrayOneItemTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php b/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php index 20c9850969..0c3755ce93 100644 --- a/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php +++ b/tests/phpunit/Mutator/ReturnValue/FloatNegationTest.php @@ -49,7 +49,7 @@ final class FloatNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php b/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php index 294269b69a..7afef1b130 100644 --- a/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php +++ b/tests/phpunit/Mutator/ReturnValue/FunctionCallTest.php @@ -52,7 +52,7 @@ final class FunctionCallTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php b/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php index 1a47318945..d57c1adf0c 100644 --- a/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php +++ b/tests/phpunit/Mutator/ReturnValue/IntegerNegationTest.php @@ -51,7 +51,7 @@ final class IntegerNegationTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php b/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php index 308113f60e..4aa26590bd 100644 --- a/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php +++ b/tests/phpunit/Mutator/ReturnValue/NewObjectTest.php @@ -55,7 +55,7 @@ public function test_it_can_mutate(string $input, $expected = [], bool $allowed if (!$allowed) { $this->markTestSkipped($message); } - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/ThisTest.php b/tests/phpunit/Mutator/ReturnValue/ThisTest.php index 602c2b7594..dde0af27c2 100644 --- a/tests/phpunit/Mutator/ReturnValue/ThisTest.php +++ b/tests/phpunit/Mutator/ReturnValue/ThisTest.php @@ -52,7 +52,7 @@ final class ThisTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php b/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php index f7823a5bbe..3dd0c7a74f 100644 --- a/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php +++ b/tests/phpunit/Mutator/ReturnValue/YieldValueTest.php @@ -49,7 +49,7 @@ final class YieldValueTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Sort/SpaceshipTest.php b/tests/phpunit/Mutator/Sort/SpaceshipTest.php index e7a2399b12..2276922b38 100644 --- a/tests/phpunit/Mutator/Sort/SpaceshipTest.php +++ b/tests/phpunit/Mutator/Sort/SpaceshipTest.php @@ -54,7 +54,7 @@ public function test_get_name(): void #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/SyntaxErrorTest.php b/tests/phpunit/Mutator/SyntaxErrorTest.php index f25726b306..bd49ed9590 100644 --- a/tests/phpunit/Mutator/SyntaxErrorTest.php +++ b/tests/phpunit/Mutator/SyntaxErrorTest.php @@ -49,7 +49,7 @@ final class SyntaxErrorTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected, [], true); + $this->assertMutatesInput($input, $expected, [], true); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php index ddb354c7ab..813ffb4bd4 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChangeKeyCaseTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayChangeKeyCaseTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php index f6752e03bc..f2b62a9eb8 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayChunkTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayChunkTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php index 8d5d9b82a8..f8604896da 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayColumnTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayColumnTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php index 43bb64c4d9..3ab1915039 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayCombineTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayCombineTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php index 855b8d19ff..6392d053cd 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffAssocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayDiffAssocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php index fab79773b9..5837901bc6 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffKeyTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayDiffKeyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php index 19c15eab05..8b68e0e4f5 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayDiffTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php index 20272965a4..3f2139e53d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUassocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayDiffUassocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php index b3bb400a53..039d83d7d7 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayDiffUkeyTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayDiffUkeyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php index c8f21d204f..a3908ef64f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFilterTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayFilterTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php index b8f784c414..647e1db70c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayFlipTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayFlipTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php index bfbd3a4fce..916dcc0d80 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayIntersectAssocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php index 54edfd2e72..8e22a01e4f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectKeyTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayIntersectKeyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php index 75d2558b16..ecd0708d7b 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayIntersectTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php index 85705903ac..afaa82ce58 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUassocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayIntersectUassocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php index 37637e2aa5..3ed132c133 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayIntersectUkeyTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayIntersectUkeyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php index c0dc3ddbbf..9a58ef3e85 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayKeysTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayKeysTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php index 237961581d..14b59d071a 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMapTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayMapTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php index 387e4764b9..d3dba95f51 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeRecursiveTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayMergeRecursiveTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php index d9fe31831c..903136e028 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayMergeTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayMergeTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php index 80a0a7ff28..8531458cc3 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayPadTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayPadTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php index ff22ecb825..ae7aa85691 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReduceTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayReduceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php index 186f93db42..02b2153d94 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceRecursiveTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayReplaceRecursiveTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php index bfb8e90b62..605ffad2f6 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReplaceTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayReplaceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php index e5506acf29..85060a8596 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayReverseTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayReverseTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php index 118caaa48c..d5209e8e3b 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArraySliceTest.php @@ -49,7 +49,7 @@ final class UnwrapArraySliceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php index e78d47198f..c8d5eac45c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArraySpliceTest.php @@ -49,7 +49,7 @@ final class UnwrapArraySpliceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php index fa3ac04cfa..f65486550d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffAssocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUdiffAssocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php index a120d0de4d..d27808c649 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUdiffTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php index cc21229cbc..f0f3ffe830 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUdiffUassocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUdiffUassocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php index c5a7997965..62d1e5628f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectAssocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUintersectAssocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php index 62ac303962..da17f954ab 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUintersectTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php index c1bc9bdb15..112d233180 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUintersectUassocTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUintersectUassocTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php index 9629275a04..095bb7323a 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayUniqueTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayUniqueTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php index 81e26552dc..bea8265247 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapArrayValuesTest.php @@ -49,7 +49,7 @@ final class UnwrapArrayValuesTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php index cabca0f87c..00a355db73 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapFinallyTest.php @@ -50,7 +50,7 @@ final class UnwrapFinallyTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, array|string $expected = [], array $settings = []): void { - $this->doTest($input, $expected, $settings); + $this->assertMutatesInput($input, $expected, $settings); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php index f83454a99d..574cf9b825 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapLcFirstTest.php @@ -49,7 +49,7 @@ final class UnwrapLcFirstTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php index 75559c7e05..ae66138c2c 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapLtrimTest.php @@ -49,7 +49,7 @@ final class UnwrapLtrimTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php index c1edd6ccad..3168378cbc 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapRtrimTest.php @@ -49,7 +49,7 @@ final class UnwrapRtrimTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php index 13b6a6038c..13be925fe4 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrIreplaceTest.php @@ -49,7 +49,7 @@ final class UnwrapStrIreplaceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php index b2b28f4186..a124bf3ea3 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrRepeatTest.php @@ -49,7 +49,7 @@ final class UnwrapStrRepeatTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php index c34dbd0755..d3d6109b7b 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrReplaceTest.php @@ -49,7 +49,7 @@ final class UnwrapStrReplaceTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php index bada097e55..525150366d 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrRevTest.php @@ -49,7 +49,7 @@ final class UnwrapStrRevTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php index 20f58989ec..ea3211312b 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrShuffleTest.php @@ -49,7 +49,7 @@ final class UnwrapStrShuffleTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php index 11407633f5..5ce9fd70a2 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrToLowerTest.php @@ -49,7 +49,7 @@ final class UnwrapStrToLowerTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php index ee78c67984..57f0d563eb 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapStrToUpperTest.php @@ -49,7 +49,7 @@ final class UnwrapStrToUpperTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php index f5e68be8bf..710865f4c0 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapSubstrTest.php @@ -49,7 +49,7 @@ final class UnwrapSubstrTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php index 1e9fd41bb2..74515281ff 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapTrimTest.php @@ -49,7 +49,7 @@ final class UnwrapTrimTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php index 2954ead0a1..ece851f668 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapUcFirstTest.php @@ -49,7 +49,7 @@ final class UnwrapUcFirstTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable diff --git a/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php b/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php index ca3d7d8ace..b42581818f 100644 --- a/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php +++ b/tests/phpunit/Mutator/Unwrap/UnwrapUcWordsTest.php @@ -49,7 +49,7 @@ final class UnwrapUcWordsTest extends BaseMutatorTestCase #[DataProvider('mutationsProvider')] public function test_it_can_mutate(string $input, $expected = []): void { - $this->doTest($input, $expected); + $this->assertMutatesInput($input, $expected); } public static function mutationsProvider(): iterable From 2e9faf56363bdfc3a3050e89232f5aa93d337a54 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:20:00 +0200 Subject: [PATCH 18/25] Remove outdated TODOs --- src/Testing/BaseMutatorTestCase.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Testing/BaseMutatorTestCase.php b/src/Testing/BaseMutatorTestCase.php index 3ee07a9a7c..2d237c9904 100644 --- a/src/Testing/BaseMutatorTestCase.php +++ b/src/Testing/BaseMutatorTestCase.php @@ -59,7 +59,6 @@ abstract class BaseMutatorTestCase extends TestCase protected function setUp(): void { - // TODO: refactor this bit... $this->mutator = $this->createMutator(); } @@ -118,7 +117,6 @@ final protected function createMutator(array $settings = []): Mutator $isBuiltinMutator = array_key_exists($mutatorClassName, array_flip(ProfileList::ALL_MUTATORS)); $mutatorName = $isBuiltinMutator ? MutatorName::getName($mutatorClassName) : $mutatorClassName; - // TODO: this is a bit ridicule... return SingletonContainer::getContainer() ->getMutatorFactory() ->create([ From fa8b489ca4303c5549a64eb330593d21aa493f14 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:21:24 +0200 Subject: [PATCH 19/25] Inline mutator node type --- src/Testing/SimpleMutation.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Testing/SimpleMutation.php b/src/Testing/SimpleMutation.php index bf53f77994..6099e19071 100644 --- a/src/Testing/SimpleMutation.php +++ b/src/Testing/SimpleMutation.php @@ -45,16 +45,13 @@ */ final class SimpleMutation extends Mutation { - /** - * @param MutatedNode $mutatedNode - */ public function __construct( /** * @var Node[] */ private readonly array $originalFileAst, private readonly Mutator $mutator, - private $mutatedNode, + private MutatedNode $mutatedNode, private readonly array $attributes, private readonly string $mutatedNodeClass, ) { From 46777a080bca1eb177b8996f3212f8bc6871699a Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:31:11 +0200 Subject: [PATCH 20/25] Fix phpstan issues --- src/Command/CustomMutatorCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/CustomMutatorCommand.php index 98196bbb1f..087f0c52fa 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/CustomMutatorCommand.php @@ -36,10 +36,10 @@ namespace Infection\Command; use function basename; -use function file_get_contents; use Infection\Console\IO; use RuntimeException; use function Safe\getcwd; +use function Safe\file_get_contents; use function sprintf; use function str_replace; use Symfony\Component\Console\Input\InputArgument; From a61768b3027add68ac24801a000a33b377d1c097 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 13:44:11 +0200 Subject: [PATCH 21/25] Rename command to `make:custom-mutator` --- ...ustomMutatorCommand.php => MakeCustomMutatorCommand.php} | 6 +++--- src/Console/Application.php | 4 ++-- .../phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/Command/{CustomMutatorCommand.php => MakeCustomMutatorCommand.php} (97%) diff --git a/src/Command/CustomMutatorCommand.php b/src/Command/MakeCustomMutatorCommand.php similarity index 97% rename from src/Command/CustomMutatorCommand.php rename to src/Command/MakeCustomMutatorCommand.php index 087f0c52fa..87391e2e0b 100644 --- a/src/Command/CustomMutatorCommand.php +++ b/src/Command/MakeCustomMutatorCommand.php @@ -38,8 +38,8 @@ use function basename; use Infection\Console\IO; use RuntimeException; -use function Safe\getcwd; use function Safe\file_get_contents; +use function Safe\getcwd; use function sprintf; use function str_replace; use Symfony\Component\Console\Input\InputArgument; @@ -50,12 +50,12 @@ /** * @internal */ -final class CustomMutatorCommand extends BaseCommand +final class MakeCustomMutatorCommand extends BaseCommand { protected function configure(): void { $this - ->setName('custom-mutator') + ->setName('make:custom-mutator') ->setDescription('Creates a custom mutator') ->addArgument('Mutator name', InputArgument::OPTIONAL); } diff --git a/src/Console/Application.php b/src/Console/Application.php index ae3d0f72b7..4b6f09e63c 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -39,8 +39,8 @@ use function class_exists; use Composer\InstalledVersions; use Infection\Command\ConfigureCommand; -use Infection\Command\CustomMutatorCommand; use Infection\Command\DescribeCommand; +use Infection\Command\MakeCustomMutatorCommand; use Infection\Command\RunCommand; use Infection\Container; use OutOfBoundsException; @@ -105,7 +105,7 @@ protected function getDefaultCommands(): array new ConfigureCommand(), new RunCommand(), new DescribeCommand(), - new CustomMutatorCommand(), + new MakeCustomMutatorCommand(), ], ); diff --git a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php index 9b4b5cc2aa..79a8a796a0 100644 --- a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php +++ b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php @@ -41,7 +41,7 @@ use function in_array; use Infection\CannotBeInstantiated; use Infection\Command\ConfigureCommand; -use Infection\Command\CustomMutatorCommand; +use Infection\Command\MakeCustomMutatorCommand; use Infection\Config\ConsoleHelper; use Infection\Config\Guesser\SourceDirGuesser; use Infection\Configuration\Schema\SchemaConfigurationFactory; @@ -134,7 +134,7 @@ final class ProjectCodeProvider StringNormalizer::class, SourceTestClassNameScheme::class, SimpleMutationsCollectorVisitor::class, - CustomMutatorCommand::class, + MakeCustomMutatorCommand::class, SingletonContainer::class, ]; From 7c9afb1084b778bfb3beebc1f5546e1cc7dd4e86 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Sun, 26 May 2024 15:35:38 +0200 Subject: [PATCH 22/25] Create interact() method for new command, add tests --- devTools/phpstan-src-baseline.neon | 10 + devTools/phpstan-tests.neon | 4 + src/Command/BaseCommand.php | 2 +- src/Command/MakeCustomMutatorCommand.php | 35 +++- src/Testing/SimpleMutation.php | 2 +- tests/phpunit/AutoReview/ContainerTest.php | 1 + .../ProjectCode/ProjectCodeProvider.php | 2 - .../Command/MakeCustomMutatorCommandTest.php | 186 ++++++++++++++++++ tests/phpunit/MockedContainer.php | 49 +++++ 9 files changed, 277 insertions(+), 14 deletions(-) create mode 100644 tests/phpunit/Command/MakeCustomMutatorCommandTest.php create mode 100644 tests/phpunit/MockedContainer.php diff --git a/devTools/phpstan-src-baseline.neon b/devTools/phpstan-src-baseline.neon index be32229310..1a8e934031 100644 --- a/devTools/phpstan-src-baseline.neon +++ b/devTools/phpstan-src-baseline.neon @@ -1,5 +1,15 @@ parameters: ignoreErrors: + - + message: "#^Anonymous function should return string but returns string\\|null\\.$#" + count: 1 + path: ../src/Command/MakeCustomMutatorCommand.php + + - + message: "#^Cannot call method askQuestion\\(\\) on Infection\\\\Console\\\\IO\\|null\\.$#" + count: 1 + path: ../src/Command/MakeCustomMutatorCommand.php + - message: "#^Parameter \\#1 \\$array of static method Webmozart\\\\Assert\\\\Assert\\:\\:keyExists\\(\\) expects array, iterable\\<\\(int\\|string\\), string\\>\\|null given\\.$#" count: 2 diff --git a/devTools/phpstan-tests.neon b/devTools/phpstan-tests.neon index d95b6656b3..6b5a9a18fc 100644 --- a/devTools/phpstan-tests.neon +++ b/devTools/phpstan-tests.neon @@ -42,6 +42,10 @@ parameters: message: "#^Instantiated class Infection\\\\Tests\\\\Fixtures\\\\Console\\\\FakeOutput not found\\.$#" count: 11 path: ../tests/* + - + message: "#^PHPDoc tag @param for parameter \\$values contains unresolvable type\\.$#" + count: 1 + path: ../tests/phpunit/MockedContainer.php level: 4 paths: - ../tests/phpunit diff --git a/src/Command/BaseCommand.php b/src/Command/BaseCommand.php index a26d3f975e..74f41bceae 100644 --- a/src/Command/BaseCommand.php +++ b/src/Command/BaseCommand.php @@ -47,7 +47,7 @@ */ abstract class BaseCommand extends Command { - private ?IO $io = null; + protected ?IO $io = null; final public function getApplication(): Application { diff --git a/src/Command/MakeCustomMutatorCommand.php b/src/Command/MakeCustomMutatorCommand.php index 87391e2e0b..159c031009 100644 --- a/src/Command/MakeCustomMutatorCommand.php +++ b/src/Command/MakeCustomMutatorCommand.php @@ -43,6 +43,8 @@ use function sprintf; use function str_replace; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; use function trim; use function ucfirst; @@ -52,23 +54,30 @@ */ final class MakeCustomMutatorCommand extends BaseCommand { + private const MUTATOT_NAME_ARGUMENT = 'Mutator name'; + protected function configure(): void { $this ->setName('make:custom-mutator') ->setDescription('Creates a custom mutator') - ->addArgument('Mutator name', InputArgument::OPTIONAL); + ->addArgument(self::MUTATOT_NAME_ARGUMENT, InputArgument::REQUIRED); } - protected function executeCommand(IO $io): bool + protected function interact(InputInterface $input, OutputInterface $output): void { - $mutatorName = $io->getInput()->getArgument('Mutator name'); + $mutatorName = $input->getArgument(self::MUTATOT_NAME_ARGUMENT); + + if ($this->mutatorNameIsEmpty($mutatorName)) { + $mutatorName = $this->askMutatorName(); - if ($mutatorName === null) { - $mutatorName = $this->askMutatorName($io); + $input->setArgument(self::MUTATOT_NAME_ARGUMENT, $mutatorName); } + } - $mutatorName = ucfirst((string) $mutatorName); + protected function executeCommand(IO $io): bool + { + $mutatorName = ucfirst(trim((string) $io->getInput()->getArgument(self::MUTATOT_NAME_ARGUMENT))); $templateFilePaths = [ __DIR__ . '/../CustomMutator/templates/__Name__.php', @@ -91,22 +100,28 @@ private static function replaceNameVariable(string $rectorName, string $contents return str_replace('__Name__', $rectorName, $contents); } - private function askMutatorName(IO $io): mixed + private function askMutatorName(): mixed { $question = new Question('What mutator do you wish to create (e.g. `AnyStringToInfectedMutator`)?'); - $question->setValidator(static function (?string $answer): string { - if ($answer === null || trim($answer) === '') { + + $question->setValidator(function (?string $answer): string { + if ($this->mutatorNameIsEmpty($answer)) { throw new RuntimeException('Mutator name is mandatory.'); } return $answer; }); - return $io->askQuestion( + return $this->io->askQuestion( $question, ); } + private function mutatorNameIsEmpty(?string $mutatorName): bool + { + return $mutatorName === null || trim($mutatorName) === ''; + } + /** * @param list $filePaths * @return list diff --git a/src/Testing/SimpleMutation.php b/src/Testing/SimpleMutation.php index 6099e19071..7ff71c8d12 100644 --- a/src/Testing/SimpleMutation.php +++ b/src/Testing/SimpleMutation.php @@ -51,7 +51,7 @@ public function __construct( */ private readonly array $originalFileAst, private readonly Mutator $mutator, - private MutatedNode $mutatedNode, + private readonly MutatedNode $mutatedNode, private readonly array $attributes, private readonly string $mutatedNodeClass, ) { diff --git a/tests/phpunit/AutoReview/ContainerTest.php b/tests/phpunit/AutoReview/ContainerTest.php index 39161dd3ad..61d5751f82 100644 --- a/tests/phpunit/AutoReview/ContainerTest.php +++ b/tests/phpunit/AutoReview/ContainerTest.php @@ -99,6 +99,7 @@ public function getContainerFiles(): array __DIR__ . '/ContainerTest.php', __DIR__ . '/../ContainerTest.php', __DIR__ . '/../SingletonContainer.php', + __DIR__ . '/../MockedContainer.php', ], ); diff --git a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php index 79a8a796a0..026c982eb5 100644 --- a/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php +++ b/tests/phpunit/AutoReview/ProjectCode/ProjectCodeProvider.php @@ -41,7 +41,6 @@ use function in_array; use Infection\CannotBeInstantiated; use Infection\Command\ConfigureCommand; -use Infection\Command\MakeCustomMutatorCommand; use Infection\Config\ConsoleHelper; use Infection\Config\Guesser\SourceDirGuesser; use Infection\Configuration\Schema\SchemaConfigurationFactory; @@ -134,7 +133,6 @@ final class ProjectCodeProvider StringNormalizer::class, SourceTestClassNameScheme::class, SimpleMutationsCollectorVisitor::class, - MakeCustomMutatorCommand::class, SingletonContainer::class, ]; diff --git a/tests/phpunit/Command/MakeCustomMutatorCommandTest.php b/tests/phpunit/Command/MakeCustomMutatorCommandTest.php new file mode 100644 index 0000000000..3ff7af88ab --- /dev/null +++ b/tests/phpunit/Command/MakeCustomMutatorCommandTest.php @@ -0,0 +1,186 @@ +createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $result = $tester->execute([ + 'Mutator name' => 'CustomMutator', + ]); + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('CustomMutator.php', $display); + $this->assertStringContainsString('CustomMutatorTest.php', $display); + } + + public function test_it_create_custom_mutator_when_name_is_not_provided_at_command_call(): void + { + $app = new Application($this->createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $tester->setInputs(['NewMutator']); + + $result = $tester->execute([]); + + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('NewMutator.php', $display); + $this->assertStringContainsString('NewMutator.php', $display); + } + + public function test_it_trims_the_argument_value(): void + { + $app = new Application($this->createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $result = $tester->execute([ + 'Mutator name' => ' CustomMutator ', + ]); + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('CustomMutator.php', $display); + $this->assertStringContainsString('CustomMutatorTest.php', $display); + } + + public function test_it_trims_the_value_from_quetion_helper(): void + { + $app = new Application($this->createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $tester->setInputs([' NewMutator ']); + + $result = $tester->execute([]); + + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('NewMutator.php', $display); + $this->assertStringContainsString('NewMutator.php', $display); + } + + public function test_it_uppercases_first_letter_of_argument_value(): void + { + $app = new Application($this->createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $result = $tester->execute([ + 'Mutator name' => ' customMutator ', + ]); + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('CustomMutator.php', $display); + $this->assertStringContainsString('CustomMutatorTest.php', $display); + } + + public function test_uppercases_the_value_from_quetion_helper(): void + { + $app = new Application($this->createContainer()); + + $tester = new CommandTester($app->find('make:custom-mutator')); + + $tester->setInputs([' newMutator ']); + + $result = $tester->execute([]); + + $this->assertSame(0, $result); + + $display = $tester->getDisplay(); + + $this->assertStringContainsString('Generated files', $display); + $this->assertStringContainsString('NewMutator.php', $display); + $this->assertStringContainsString('NewMutator.php', $display); + } + + private function createFileSystemMock(): MockObject + { + /** + * @var Filesystem|MockObject + */ + $fileSystemMock = $this->createMock(Filesystem::class); + + $fileSystemMock + ->expects($this->exactly(2)) + ->method('dumpFile') + ; + + return $fileSystemMock; + } + + private function createContainer() + { + $container = MockedContainer::createWithServices([ + Filesystem::class => fn () => $this->createFileSystemMock(), + ]); + + return $container; + } +} diff --git a/tests/phpunit/MockedContainer.php b/tests/phpunit/MockedContainer.php new file mode 100644 index 0000000000..852d7bccb0 --- /dev/null +++ b/tests/phpunit/MockedContainer.php @@ -0,0 +1,49 @@ +, Closure(Container): object> $values + */ + public static function createWithServices(array $values): Container + { + return new Container($values); + } +} From ebb0ca8a62468b05d53fa0b0de3f4b519d3f359c Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 27 May 2024 18:40:40 +0200 Subject: [PATCH 23/25] Rename command to `make:mutator` --- src/Command/MakeCustomMutatorCommand.php | 2 +- .../phpunit/Command/MakeCustomMutatorCommandTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Command/MakeCustomMutatorCommand.php b/src/Command/MakeCustomMutatorCommand.php index 159c031009..67b8e02f1c 100644 --- a/src/Command/MakeCustomMutatorCommand.php +++ b/src/Command/MakeCustomMutatorCommand.php @@ -59,7 +59,7 @@ final class MakeCustomMutatorCommand extends BaseCommand protected function configure(): void { $this - ->setName('make:custom-mutator') + ->setName('make:mutator') ->setDescription('Creates a custom mutator') ->addArgument(self::MUTATOT_NAME_ARGUMENT, InputArgument::REQUIRED); } diff --git a/tests/phpunit/Command/MakeCustomMutatorCommandTest.php b/tests/phpunit/Command/MakeCustomMutatorCommandTest.php index 3ff7af88ab..9469dd6ed6 100644 --- a/tests/phpunit/Command/MakeCustomMutatorCommandTest.php +++ b/tests/phpunit/Command/MakeCustomMutatorCommandTest.php @@ -53,7 +53,7 @@ public function test_it_create_custom_mutator_when_name_is_provided(): void { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $result = $tester->execute([ 'Mutator name' => 'CustomMutator', @@ -71,7 +71,7 @@ public function test_it_create_custom_mutator_when_name_is_not_provided_at_comma { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $tester->setInputs(['NewMutator']); @@ -90,7 +90,7 @@ public function test_it_trims_the_argument_value(): void { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $result = $tester->execute([ 'Mutator name' => ' CustomMutator ', @@ -108,7 +108,7 @@ public function test_it_trims_the_value_from_quetion_helper(): void { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $tester->setInputs([' NewMutator ']); @@ -127,7 +127,7 @@ public function test_it_uppercases_first_letter_of_argument_value(): void { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $result = $tester->execute([ 'Mutator name' => ' customMutator ', @@ -145,7 +145,7 @@ public function test_uppercases_the_value_from_quetion_helper(): void { $app = new Application($this->createContainer()); - $tester = new CommandTester($app->find('make:custom-mutator')); + $tester = new CommandTester($app->find('make:mutator')); $tester->setInputs([' newMutator ']); From 972ec627c1399a01791d55531238d621d77b95f3 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Mon, 27 May 2024 18:41:08 +0200 Subject: [PATCH 24/25] Fix typo --- src/Command/MakeCustomMutatorCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Command/MakeCustomMutatorCommand.php b/src/Command/MakeCustomMutatorCommand.php index 67b8e02f1c..9debaf1c34 100644 --- a/src/Command/MakeCustomMutatorCommand.php +++ b/src/Command/MakeCustomMutatorCommand.php @@ -54,30 +54,30 @@ */ final class MakeCustomMutatorCommand extends BaseCommand { - private const MUTATOT_NAME_ARGUMENT = 'Mutator name'; + private const MUTATOR_NAME_ARGUMENT = 'Mutator name'; protected function configure(): void { $this ->setName('make:mutator') ->setDescription('Creates a custom mutator') - ->addArgument(self::MUTATOT_NAME_ARGUMENT, InputArgument::REQUIRED); + ->addArgument(self::MUTATOR_NAME_ARGUMENT, InputArgument::REQUIRED); } protected function interact(InputInterface $input, OutputInterface $output): void { - $mutatorName = $input->getArgument(self::MUTATOT_NAME_ARGUMENT); + $mutatorName = $input->getArgument(self::MUTATOR_NAME_ARGUMENT); if ($this->mutatorNameIsEmpty($mutatorName)) { $mutatorName = $this->askMutatorName(); - $input->setArgument(self::MUTATOT_NAME_ARGUMENT, $mutatorName); + $input->setArgument(self::MUTATOR_NAME_ARGUMENT, $mutatorName); } } protected function executeCommand(IO $io): bool { - $mutatorName = ucfirst(trim((string) $io->getInput()->getArgument(self::MUTATOT_NAME_ARGUMENT))); + $mutatorName = ucfirst(trim((string) $io->getInput()->getArgument(self::MUTATOR_NAME_ARGUMENT))); $templateFilePaths = [ __DIR__ . '/../CustomMutator/templates/__Name__.php', From 7d3fdacd19acbe736dc3874f3735d83112d397e3 Mon Sep 17 00:00:00 2001 From: maks-rafalko Date: Tue, 28 May 2024 00:22:06 +0200 Subject: [PATCH 25/25] Allow custom mutator to be used in `--mutators=X,Y,Z` option --- src/Mutator/MutatorParser.php | 4 ++++ tests/e2e/Custom_Mutator/composer.json | 5 +++++ tests/phpunit/Mutator/MutatorParserTest.php | 16 ++++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Mutator/MutatorParser.php b/src/Mutator/MutatorParser.php index b95ce2e67a..1ad241c54f 100644 --- a/src/Mutator/MutatorParser.php +++ b/src/Mutator/MutatorParser.php @@ -86,6 +86,10 @@ public function parse(string $unparsedMutators): array continue; } + if (MutatorResolver::isValidMutator($profileOrMutator)) { + continue; + } + throw new UnexpectedValueException( sprintf( 'Expected "%s" to be a known mutator or profile. See "%s" and "%s" for ' diff --git a/tests/e2e/Custom_Mutator/composer.json b/tests/e2e/Custom_Mutator/composer.json index 10920f6ee8..05c06e4371 100644 --- a/tests/e2e/Custom_Mutator/composer.json +++ b/tests/e2e/Custom_Mutator/composer.json @@ -14,5 +14,10 @@ }, "require": { "infection/mutator": "^0.4.0" + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } } } diff --git a/tests/phpunit/Mutator/MutatorParserTest.php b/tests/phpunit/Mutator/MutatorParserTest.php index 02d2d613d9..63ba30a936 100644 --- a/tests/phpunit/Mutator/MutatorParserTest.php +++ b/tests/phpunit/Mutator/MutatorParserTest.php @@ -36,6 +36,7 @@ namespace Infection\Tests\Mutator; use Infection\Mutator\MutatorParser; +use Infection\Tests\Fixtures\Mutator\FakeMutator; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; @@ -43,10 +44,7 @@ #[CoversClass(MutatorParser::class)] final class MutatorParserTest extends TestCase { - /** - * @var MutatorParser - */ - private $mutatorParser; + private MutatorParser $mutatorParser; protected function setUp(): void { @@ -99,5 +97,15 @@ public static function mutatorInputProvider(): iterable '@boolean', ], ]; + + yield 'custom mutator class' => [ + 'Minus,@boolean,Infection\\Tests\\Fixtures\\Mutator\\FakeMutator,Minus', + [ + 'Minus', + '@boolean', + FakeMutator::class, + 'Minus', + ], + ]; } }