Skip to content

Add own assertions with better exception messages #8

Add own assertions with better exception messages

Add own assertions with better exception messages #8

Triggered via push June 6, 2024 10:30
Status Failure
Total duration 1m 36s
Artifacts

build.yaml

on: push
Matrix: Code Coverage
Matrix: Coding Standards
Matrix: Dependency Analysis
Matrix: Mutation tests
Matrix: Static Code Analysis
Matrix: Unit tests
Fit to window
Zoom out
Zoom in

Annotations

9 errors and 7 warnings
Dependency Analysis (8.1, lowest)
Process completed with exit code 1.
Dependency Analysis (8.2, highest)
Process completed with exit code 1.
Dependency Analysis (8.2, lowest)
The job was canceled because "_8_1_lowest" failed.
Dependency Analysis (8.1, highest)
The job was canceled because "_8_1_lowest" failed.
Dependency Analysis (8.3, highest)
The job was canceled because "_8_1_lowest" failed.
Dependency Analysis (8.1, highest)
Process completed with exit code 1.
Dependency Analysis (8.3, highest)
Process completed with exit code 1.
Dependency Analysis (8.3, lowest)
The job was canceled because "_8_1_lowest" failed.
Mutation tests (8.3, highest)
Process completed with exit code 1.
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L41
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ */ protected static function convertDateTime(null|\DateTimeImmutable|string $value) : ?\DateTimeImmutable { - if (null === $value || $value instanceof \DateTimeImmutable) { + if (null === $value || false) { return $value; } $res = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $value);
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L46
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ return $value; } $res = \DateTimeImmutable::createFromFormat(\DATE_ATOM, $value); - if (false === $res) { + if (true === $res) { throw new \InvalidArgumentException(sprintf('The value %s is not a valid date time string based on the format %s', $value, \DATE_ATOM)); } return $res;
Mutation tests (8.3, highest): src/DataTransferObject/AbstractDataTransferObject.php#L69
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ if (null === $value) { return null; } - if ($value instanceof \BackedEnum) { + if (false) { if (!is_a($value, $enumClass)) { throw new \InvalidArgumentException(sprintf('The value %s is not an instance of the enum class %s', $value::class, $enumClass)); }
Mutation tests (8.3, highest): src/DataTransferObject/SalesOrder/SalesOrder.php#L78
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ * Otherwise, PeakWMS will not be able to find and capture the order in the payment integration. */ public ?string $transactionNumber = null, - public bool $giftWrap = false, + public bool $giftWrap = true, public ?string $customerReference = null, int|PaymentStatus $paymentStatus = null, int|PickAgainReason $pickAgainReason = null,
Mutation tests (8.3, highest): src/DataTransferObject/SalesOrder/SalesOrder.php#L86
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ public ?Address $shippingAddress = null, public ?Address $senderAddress = null, public ?string $sendWithOrder = null, - public bool $generateAndPrintDeliveryNote = false, + public bool $generateAndPrintDeliveryNote = true, array $orderLines = [] ) {
Mutation tests (8.3, highest): src/DataTransferObject/SalesOrder/SalesOrder.php#L90
Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ ) { $this->orderId = (string) $orderId; - $this->orderNumber = (string) $orderNumber; + $this->orderNumber = $orderNumber; $this->orderDateTime = self::convertDateTime($orderDateTime); $this->requestedDeliveryDate = self::convertDateTime($requestedDeliveryDate); $this->state = self::convertEnum($state, State::class);
Mutation tests (8.3, highest): src/DataTransferObject/SalesOrder/SalesOrder.php#L98
Escaped Mutant for Mutator "Foreach_": --- Original +++ New @@ @@ $this->onHoldReason = self::convertEnum($onHoldReason, OnHoldReason::class); $this->paymentStatus = self::convertEnum($paymentStatus, PaymentStatus::class); $this->pickAgainReason = self::convertEnum($pickAgainReason, PickAgainReason::class); - foreach ($orderLines as $orderLine) { + foreach (array() as $orderLine) { $this->addOrderLine($orderLine); } }