feat: allow phpunit v11 (#92) #233
Annotations
11 warnings
Infection
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Infection:
src/Stub.php#L37
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
if ($reflectionProperty === null) {
throw new ReflectionException(sprintf('Property "%s" not found', $property));
}
- $reflectionProperty->setAccessible(true);
+ $reflectionProperty->setAccessible(false);
$reflectionProperty->setValue($stub, $value);
}
return $stub;
|
Infection:
src/Stub.php#L37
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if ($reflectionProperty === null) {
throw new ReflectionException(sprintf('Property "%s" not found', $property));
}
- $reflectionProperty->setAccessible(true);
+
$reflectionProperty->setValue($stub, $value);
}
return $stub;
|
Infection:
src/Stub.php#L62
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
/** @var array<string, mixed> $properties */
$properties = [];
foreach (self::getAllProperties($reflection) as $property) {
- $property->setAccessible(true);
+ $property->setAccessible(false);
if (!$property->isInitialized($stub)) {
continue;
}
|
Infection:
src/Stub.php#L62
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
/** @var array<string, mixed> $properties */
$properties = [];
foreach (self::getAllProperties($reflection) as $property) {
- $property->setAccessible(true);
+
if (!$property->isInitialized($stub)) {
continue;
}
|
Infection:
src/Stub.php#L115
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
* @phpstan-var ReflectionClass<T>|false $parentClass
*/
$parentClass = $reflection->getParentClass();
- if ($parentClass === false) {
+ if ($parentClass !== false) {
return $properties;
}
return self::getAllProperties($parentClass, $properties);
}
}
|
Infection:
src/TestCheck/EveryTestHasGroup.php#L64
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
foreach ($groups as $group) {
if ($this->requiredGroups !== null && in_array($group, $this->requiredGroups, true)) {
$hasRequiredGroup = true;
- continue;
+ break;
}
if ($this->supportedGroups === null) {
continue;
|
Infection:
src/TestCheck/EveryTestHasGroup.php#L68
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
continue;
}
if ($this->supportedGroups === null) {
- continue;
+ break;
}
$testCaseContext::assertContains($group, $this->supportedGroups, sprintf('Test "%s" has invalid Group attribute "%s"', $classReflection->getName(), $group));
}
|
Infection:
src/TestCheck/EveryTestHasSameNamespaceAsCoveredClass.php#L56
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
$testCaseContext::fail(sprintf('Specifying CoversClass and CoversNothing attributes at the same time makes no sense (in "%s").', $filePathName));
}
if ($hasCoversNothing || $hasCovers) {
- continue;
+ break;
}
$className = $classReflection->getName();
$classNameWithoutSuffix = substr($className, 0, -4);
|
Infection:
src/TestCheck/EveryTestHasSameNamespaceAsCoveredClass.php#L62
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
$className = $classReflection->getName();
$classNameWithoutSuffix = substr($className, 0, -4);
$pos = strpos($classNameWithoutSuffix, $this->testsNamespaceSuffix);
- if ($pos === false) {
+ if ($pos === true) {
$coveredClassName = $classNameWithoutSuffix;
} else {
$coveredClassName = substr_replace($classNameWithoutSuffix, '\\', $pos, strlen($this->testsNamespaceSuffix));
|
Infection:
src/TestCheck/EveryTestHasSameNamespaceAsCoveredClass.php#L74
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
$coveredClassName = substr_replace($classNameWithoutSuffix, '\\', $pos, strlen($this->testsNamespaceSuffix));
}
if (class_exists($coveredClassName) || trait_exists($coveredClassName)) {
- continue;
+ break;
}
$testCaseContext::fail(sprintf('Test "%s" is in the wrong namespace, ' . 'has name different from tested class or is missing CoversClass attribute', $classReflection->getName()));
}
}
}
|