Skip to content

Fix for the unit test and throwing an exception in the action class w… #44

Fix for the unit test and throwing an exception in the action class w…

Fix for the unit test and throwing an exception in the action class w… #44

Re-run triggered October 8, 2024 16:47
Status Success
Total duration 32s
Artifacts 1

tests.yml

on: push
docker-build
28s
docker-build
Matrix: composer-normalize
Matrix: composer-require-checker
Matrix: composer-unused
Matrix: composer-validate
Matrix: linter
Matrix: mutation-tests
Matrix: refactoring
Matrix: static-analysis
Matrix: unit-tests
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
mutation-tests (8.3): src/Action.php#L36
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ throw new \Exception('Directory "' . $directory . '" is already exists'); } // rights - mkdir($directory, 0755, true); + mkdir($directory, 492, true); $ignore = new IgnoreFile(); $zip = new \ZipArchive(); if ($zip->open((string) $this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) {
mutation-tests (8.3): src/Action.php#L36
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ throw new \Exception('Directory "' . $directory . '" is already exists'); } // rights - mkdir($directory, 0755, true); + mkdir($directory, 494, true); $ignore = new IgnoreFile(); $zip = new \ZipArchive(); if ($zip->open((string) $this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) {
mutation-tests (8.3): src/Action.php#L47
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ throw new \Exception('Failed to create zip archive'); } $rootDirectory = $this->configuration->getRootDirectory(); - if (!is_dir($rootDirectory) || !is_readable($rootDirectory) || !is_writable($rootDirectory)) { + if (!is_dir($rootDirectory) && !is_readable($rootDirectory) || !is_writable($rootDirectory)) { throw new \Exception(\sprintf('Directory "%s" is not exists or is not readable or is not writable', $rootDirectory)); } $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST);
mutation-tests (8.3): src/Action.php#L47
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ throw new \Exception('Failed to create zip archive'); } $rootDirectory = $this->configuration->getRootDirectory(); - if (!is_dir($rootDirectory) || !is_readable($rootDirectory) || !is_writable($rootDirectory)) { + if ((!is_dir($rootDirectory) || !is_readable($rootDirectory)) && !is_writable($rootDirectory)) { throw new \Exception(\sprintf('Directory "%s" is not exists or is not readable or is not writable', $rootDirectory)); } $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST);
mutation-tests (8.3): src/Action.php#L58
Escaped Mutant for Mutator "Foreach_": --- Original +++ New @@ @@ throw new \Exception(\sprintf('Directory "%s" is not exists or is not readable or is not writable', $rootDirectory)); } $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST); - foreach ($iterator as $path) { + foreach (array() as $path) { /** * @var \SplFileInfo $path */
mutation-tests (8.3): src/Action.php#L79
Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace(\DIRECTORY_SEPARATOR . $rootDirectory, '', $path->getPathname())); } } $zip->close();
mutation-tests (8.3): src/Action.php#L79
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace(\DIRECTORY_SEPARATOR, '', $path->getPathname())); } } $zip->close();
mutation-tests (8.3): src/Action.php#L79
Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), str_replace($rootDirectory, '', $path->getPathname())); } } $zip->close();
mutation-tests (8.3): src/Action.php#L79
Escaped Mutant for Mutator "UnwrapStrReplace": --- Original +++ New @@ @@ continue; } if (!$ignore->ignores($path->getPathname())) { - $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); + $zip->addFile($path->getPathname(), $path->getPathname()); } } $zip->close();
mutation-tests (8.3): src/Action.php#L83
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $zip->addFile($path->getPathname(), str_replace($rootDirectory . \DIRECTORY_SEPARATOR, '', $path->getPathname())); } } - $zip->close(); + $GITHUB_OUTPUT = (string) $this->configuration->get('GITHUB_OUTPUT'); if (!empty($GITHUB_OUTPUT)) { $name = 'directory_path';