Add AbstractProvider #159
mutation-testing.yml
on: pull_request
Mutation Tests
1m 46s
Annotations
11 warnings
Mutation Tests
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Mutation Tests:
src/Console/ConsoleFacade.php#L33
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
{
return $this->getFactory()->createCommandArgumentsParser()->parse($desiredNamespace);
}
- public function generateFileContent(CommandArguments $commandArguments, string $filename, bool $withShortName = false) : string
+ public function generateFileContent(CommandArguments $commandArguments, string $filename, bool $withShortName = true) : string
{
return $this->getFactory()->createFileContentGenerator()->generate($commandArguments, $filename, $withShortName);
}
|
Mutation Tests:
src/Console/ConsoleFactory.php#L39
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
*/
public function getConsoleCommands() : array
{
- return (array) $this->getProvidedDependency(ConsoleProvider::COMMANDS);
+ return $this->getProvidedDependency(ConsoleProvider::COMMANDS);
}
public function createCommandArgumentsParser() : CommandArgumentsParserInterface
{
|
Mutation Tests:
src/Console/ConsoleFactory.php#L102
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
*/
private function getTemplateByFilenameMap() : array
{
- return (array) $this->getProvidedDependency(ConsoleProvider::TEMPLATE_BY_FILENAME_MAP);
+ return $this->getProvidedDependency(ConsoleProvider::TEMPLATE_BY_FILENAME_MAP);
}
}
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L49
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
}
private function createAppModule(SplFileInfo $fileInfo, string $filter) : ?AppModule
{
- if (!$fileInfo->isFile() || $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), 'vendor' . DIRECTORY_SEPARATOR)) {
+ if (!$fileInfo->isFile() && $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), 'vendor' . DIRECTORY_SEPARATOR)) {
return null;
}
$namespace = $this->getNamespace($fileInfo);
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L51
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
}
private function createAppModule(SplFileInfo $fileInfo, string $filter) : ?AppModule
{
- if (!$fileInfo->isFile() || $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), 'vendor' . DIRECTORY_SEPARATOR)) {
+ if (!$fileInfo->isFile() || $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), DIRECTORY_SEPARATOR . 'vendor')) {
return null;
}
$namespace = $this->getNamespace($fileInfo);
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L51
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
}
private function createAppModule(SplFileInfo $fileInfo, string $filter) : ?AppModule
{
- if (!$fileInfo->isFile() || $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), 'vendor' . DIRECTORY_SEPARATOR)) {
+ if (!$fileInfo->isFile() || $fileInfo->getExtension() !== 'php' || str_contains($fileInfo->getRealPath(), 'vendor')) {
return null;
}
$namespace = $this->getNamespace($fileInfo);
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L81
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
}
private function getNamespace(SplFileInfo $fileInfo) : string
{
- $fileContent = (string) file_get_contents($fileInfo->getRealPath());
+ $fileContent = file_get_contents($fileInfo->getRealPath());
preg_match('#namespace (.*);#', $fileContent, $matches);
return $matches[1] ?? '';
}
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L93
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
{
$pieces = explode(DIRECTORY_SEPARATOR, $fileInfo->getFilename());
$filename = end($pieces);
- return substr($filename, 0, strpos($filename, '.') ?: 1);
+ return substr($filename, 0, strpos($filename, '.') ?: 0);
}
private function isFacade(AppModule $appModule) : bool
{
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L93
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
{
$pieces = explode(DIRECTORY_SEPARATOR, $fileInfo->getFilename());
$filename = end($pieces);
- return substr($filename, 0, strpos($filename, '.') ?: 1);
+ return substr($filename, 0, strpos($filename, '.') ?: 2);
}
private function isFacade(AppModule $appModule) : bool
{
|
Mutation Tests:
src/Console/Domain/AllAppModules/AllAppModulesFinder.php#L101
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
{
$rc = new ReflectionClass($appModule->facadeClass());
$parentClass = $rc->getParentClass();
- return $parentClass !== false && $parentClass->name === AbstractFacade::class;
+ return $parentClass !== true && $parentClass->name === AbstractFacade::class;
}
}
|