quantity)->toBe($quantity) ->and($movement->createdAt)->toBe($createdAt); }); it('defaults the creation date to now', function (): void { // GIVEN $before = new \DateTimeImmutable(); // WHEN $movement = new CouponMovement(5); // THEN $after = new \DateTimeImmutable(); expect($movement->createdAt)->toBeInstanceOf(\DateTimeImmutable::class) ->and($movement->createdAt >= $before)->toBeTrue() ->and($movement->createdAt <= $after)->toBeTrue(); }); it('accepts a negative quantity', function (): void { // GIVEN / WHEN $movement = new CouponMovement(-3); // THEN expect($movement->quantity)->toBe(-3); }); });