Setup mutation testing #310
Annotations
1 error and 10 warnings
Platform test (8.1, doctrine/orm:^3.0 doctrine/dbal:^4.0 carbonphp/carbon-doctrine-types:^3 gedmo...
Process completed with exit code 1.
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/Query/QueryResultTypeWalker.php#L784
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
$exprTypeNoNull = TypeCombinator::removeNull($exprType);
$nullable = $this->canBeNull($exprType) || $this->hasAggregateWithoutGroupBy();
if ($this->driverType === DriverDetector::SQLITE3 || $this->driverType === DriverDetector::PDO_SQLITE) {
- if ($exprTypeNoNull->isString()->yes() && !$exprTypeNoNull->isNumericString()->yes()) {
+ if ($exprTypeNoNull->isString()->yes() && !!$exprTypeNoNull->isNumericString()->no()) {
return $this->createFloat($nullable);
}
return $this->generalizeConstantType($exprType, $nullable);
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/Query/QueryResultTypeWalker.php#L784
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
$exprTypeNoNull = TypeCombinator::removeNull($exprType);
$nullable = $this->canBeNull($exprType) || $this->hasAggregateWithoutGroupBy();
if ($this->driverType === DriverDetector::SQLITE3 || $this->driverType === DriverDetector::PDO_SQLITE) {
- if ($exprTypeNoNull->isString()->yes() && !$exprTypeNoNull->isNumericString()->yes()) {
+ if (!$exprTypeNoNull->isString()->no() && !$exprTypeNoNull->isNumericString()->yes()) {
return $this->createFloat($nullable);
}
return $this->generalizeConstantType($exprType, $nullable);
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/Query/QueryResultTypeWalker.php#L575
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
$secondExprType = $this->unmarshalType($this->walkSimpleArithmeticExpression($function->secondSimpleArithmeticExpression));
$union = TypeCombinator::union($firstExprType, $secondExprType);
$unionNoNull = TypeCombinator::removeNull($union);
- if (!$unionNoNull->isInteger()->yes()) {
+ if (!!$unionNoNull->isInteger()->no()) {
return $this->marshalType(new MixedType());
// dont try to deal with non-integer chaos
}
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/HydrationModeReturnTypeResolver.php#L94
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
}
private function getSimpleObjectHydratedReturnType(Type $queryResultType): ?Type
{
- if ((new ObjectWithoutClassType())->isSuperTypeOf($queryResultType)->yes()) {
+ if (!(new ObjectWithoutClassType())->isSuperTypeOf($queryResultType)->no()) {
return $queryResultType;
}
return null;
}
}
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/HydrationModeReturnTypeResolver.php#L79
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
case 'toIterable':
return new IterableType($queryKeyType->isNull()->yes() ? new IntegerType() : $queryKeyType, $queryResultType);
default:
- if ($queryKeyType->isNull()->yes()) {
+ if (!$queryKeyType->isNull()->no()) {
return TypeCombinator::intersect(new ArrayType(new IntegerType(), $queryResultType), new AccessoryArrayListType());
}
return new ArrayType($queryKeyType, $queryResultType);
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/HydrationModeReturnTypeResolver.php#L75
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
}
return $nullableQueryResultType;
case 'toIterable':
- return new IterableType($queryKeyType->isNull()->yes() ? new IntegerType() : $queryKeyType, $queryResultType);
+ return new IterableType(!$queryKeyType->isNull()->no() ? new IntegerType() : $queryKeyType, $queryResultType);
default:
if ($queryKeyType->isNull()->yes()) {
return TypeCombinator::intersect(new ArrayType(new IntegerType(), $queryResultType), new AccessoryArrayListType());
|
Platform test (8.4, true, infection/infection):
src/Type/Doctrine/EntityManagerInterfaceThrowTypeExtension.php#L38
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
public function getThrowTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): ?Type
{
$type = $scope->getType($methodCall->var);
- if ((new ObjectType(EntityManagerInterface::class))->isSuperTypeOf($type)->yes()) {
+ if (!(new ObjectType(EntityManagerInterface::class))->isSuperTypeOf($type)->no()) {
return TypeCombinator::union(...array_map(static fn($class): Type => new ObjectType($class), self::SUPPORTED_METHOD[$methodReflection->getName()]));
}
return $methodReflection->getThrowType();
}
}
|
Platform test (8.4, true, infection/infection):
src/Rules/Doctrine/ORM/EntityRelationRule.php#L112
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
}
$collectionObjectType = new ObjectType('Doctrine\Common\Collections\Collection');
$propertyTypeToCheckAgainst = $propertyType;
- if ($toMany && $collectionObjectType->isSuperTypeOf($propertyType)->yes() && $propertyType->isIterable()->yes()) {
+ if ($toMany && $collectionObjectType->isSuperTypeOf($propertyType)->yes() && !$propertyType->isIterable()->no()) {
$propertyTypeToCheckAgainst = TypeCombinator::intersect($collectionObjectType, new IterableType(new MixedType(true), $propertyType->getIterableValueType()));
}
if (!$propertyTypeToCheckAgainst->isSuperTypeOf($columnType)->yes()) {
|
Platform test (8.4, true, infection/infection):
src/Rules/Doctrine/ORM/EntityRelationRule.php#L111
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
}
$collectionObjectType = new ObjectType('Doctrine\Common\Collections\Collection');
$propertyTypeToCheckAgainst = $propertyType;
- if ($toMany && $collectionObjectType->isSuperTypeOf($propertyType)->yes() && $propertyType->isIterable()->yes()) {
+ if ($toMany && !$collectionObjectType->isSuperTypeOf($propertyType)->no() && $propertyType->isIterable()->yes()) {
$propertyTypeToCheckAgainst = TypeCombinator::intersect($collectionObjectType, new IterableType(new MixedType(true), $propertyType->getIterableValueType()));
}
if (!$propertyTypeToCheckAgainst->isSuperTypeOf($columnType)->yes()) {
|
Platform test (8.4, true, infection/infection):
src/Rules/Doctrine/ORM/DqlRule.php#L52
Escaped Mutant for Mutator "TrinaryLogicMutator":
@@ @@
}
$calledOnType = $scope->getType($node->var);
$entityManagerInterface = 'Doctrine\ORM\EntityManagerInterface';
- if (!(new ObjectType($entityManagerInterface))->isSuperTypeOf($calledOnType)->yes()) {
+ if (!!(new ObjectType($entityManagerInterface))->isSuperTypeOf($calledOnType)->no()) {
return [];
}
$dqls = $scope->getType($node->getArgs()[0]->value)->getConstantStrings();
|