id)->toBe($id) ->and($printed->printableCode)->toBe($printableCode) ->and($printed->couponCode)->toBe($couponCode) ->and($printed->campaignCode)->toBe($campaignCode) ->and($printed->customer)->toBe($customer) ->and($printed->printedAt)->toBe($printedAt); }); it('derives the printing date from its id', function () use ($marketingCode, $printableCode, $couponCode, $campaignCode, $customer): void { // GIVEN $id = PrintedCouponId::generate(); $printed = new PrintedCoupon( $id, $marketingCode, $printableCode, $couponCode, $campaignCode, $customer, new \DateTimeImmutable('2020-01-01'), ); // WHEN $date = $printed->printedAt(); // THEN expect($date)->toEqual($id->toDateTime()) ->and($date)->not->toEqual($printed->printedAt); }); });