A new fix: added access check during recursive directory traversal an… #40
tests.yml
on: push
docker-build
34s
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
Annotations
1 error and 10 warnings
unit-tests (8.3)
Process completed with exit code 1.
|
mutation-tests (8.3):
src/Action.php#L28
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
if (!\extension_loaded('zip')) {
throw new \Exception('ZIP extension is not loaded');
}
- $directory = (string) $this->configuration->get('build.directory');
+ $directory = $this->configuration->get('build.directory');
if (is_dir($directory)) {
throw new \Exception('Directory "' . $directory . '" is already exists');
}
|
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#L41
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
mkdir($directory, 0755, true);
$ignore = new IgnoreFile();
$zip = new \ZipArchive();
- if ($zip->open((string) $this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) {
+ if ($zip->open($this->configuration->get('build.file'), \ZipArchive::CREATE) !== true) {
throw new \Exception('Failed to create zip archive');
}
$rootDirectory = $this->configuration->getRootDirectory();
|
mutation-tests (8.3):
src/Action.php#L47
Escaped Mutant for Mutator "LogicalAnd":
--- 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)) {
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $path) {
/**
|
mutation-tests (8.3):
src/Action.php#L47
Escaped Mutant for Mutator "LogicalAnd":
--- 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)) {
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($rootDirectory), \RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $path) {
/**
|
mutation-tests (8.3):
src/Action.php#L54
Escaped Mutant for Mutator "Foreach_":
--- Original
+++ New
@@ @@
$rootDirectory = $this->configuration->getRootDirectory();
if (is_dir($rootDirectory) && is_readable($rootDirectory) && is_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#L75
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()));
}
}
}
|
mutation-tests (8.3):
src/Action.php#L75
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()));
}
}
}
|
mutation-tests (8.3):
src/Action.php#L75
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()));
}
}
}
|
mutation-tests (8.3):
src/Action.php#L75
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());
}
}
}
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
rosven9856~composer-package-action~RVVIHL.dockerbuild
Expired
|
46.9 KB |
|