Skip to content

Fixes for ranning tests in db package #1409

Fixes for ranning tests in db package

Fixes for ranning tests in db package #1409

Triggered via pull request November 28, 2024 10:02
Status Success
Total duration 7m 30s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
PHP 8.3: src/Command/CreateCommand.php#L94
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ protected function execute(InputInterface $input, OutputInterface $output) : int { $io = new SymfonyStyle($input, $output); - $this->migrator->setIo($io); + $this->migrationService->setIo($io); $this->createService->setIo($io); /** @var string|null $path */
PHP 8.3: src/Command/CreateCommand.php#L144
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ $name = $this->generateName($command, $table, $and); $className = $this->migrationService->generateClassName($name); $nameLimit = $this->migrator->getMigrationNameLimit(); - if ($nameLimit !== 0 && strlen($className) > $nameLimit) { + if ($nameLimit !== -1 && strlen($className) > $nameLimit) { $io->error('The migration name is too long.'); return Command::INVALID; }
PHP 8.3: src/Command/CreateCommand.php#L144
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ $name = $this->generateName($command, $table, $and); $className = $this->migrationService->generateClassName($name); $nameLimit = $this->migrator->getMigrationNameLimit(); - if ($nameLimit !== 0 && strlen($className) > $nameLimit) { + if ($nameLimit !== 0 && strlen($className) >= $nameLimit) { $io->error('The migration name is too long.'); return Command::INVALID; }
PHP 8.3: src/Command/CreateCommand.php#L187
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php'; file_put_contents($file, $content, LOCK_EX); $output->writeln("\n\t<info>{$className}</info>"); - $output->writeln("\n"); + $io->success('New migration created successfully.'); } $this->migrationService->databaseConnection();
PHP 8.3: src/Command/CreateCommand.php#L200
Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ 'addColumn' => 'Add_Column_' . $name, 'dropColumn' => 'Drop_Column_' . $name, 'junction' => 'Junction_Table_For_' . $name . '_And_' . (string) $and . '_Tables', - default => $result, }; } }
PHP 8.3: src/Command/CreateCommand.php#L203
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ return match ($command) { 'create' => $name, 'table' => 'Create_' . $name . '_Table', - 'dropTable' => 'Drop_' . $name . '_Table', + 'dropTable' => 'Drop_' . '_Table', 'addColumn' => 'Add_Column_' . $name, 'dropColumn' => 'Drop_Column_' . $name, 'junction' => 'Junction_Table_For_' . $name . '_And_' . (string) $and . '_Tables',
PHP 8.3: src/Command/CreateCommand.php#L203
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ return match ($command) { 'create' => $name, 'table' => 'Create_' . $name . '_Table', - 'dropTable' => 'Drop_' . $name . '_Table', + 'dropTable' => 'Drop_' . $name, 'addColumn' => 'Add_Column_' . $name, 'dropColumn' => 'Drop_Column_' . $name, 'junction' => 'Junction_Table_For_' . $name . '_And_' . (string) $and . '_Tables',
PHP 8.3: src/Command/CreateCommand.php#L204
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ 'create' => $name, 'table' => 'Create_' . $name . '_Table', 'dropTable' => 'Drop_' . $name . '_Table', - 'addColumn' => 'Add_Column_' . $name, + 'addColumn' => $name, 'dropColumn' => 'Drop_Column_' . $name, 'junction' => 'Junction_Table_For_' . $name . '_And_' . (string) $and . '_Tables', default => $result,
PHP 8.3: src/Command/NewCommand.php#L73
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->migrationService->setSourcePaths($paths); $this->migrationService->setSourceNamespaces($namespaces); } - $this->migrationService->before(self::getDefaultName() ?? ''); + $limit = !$input->getOption('all') ? (int) $input->getOption('limit') : null; if ($limit !== null && $limit <= 0) { $io->error('The limit option must be greater than 0.');
PHP 8.3: src/Command/NewCommand.php#L107
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ $io->section("Found {$n} new {$migrationWord}:"); } foreach ($migrations as $i => $migration) { - $output->writeln("<info>\t" . ($i + 1) . ". {$migration}</info>"); + $output->writeln("<info>\t" . ". {$migration}</info>"); } $this->migrationService->databaseConnection(); return Command::SUCCESS; } }