ldc-mesbr-app/tests/Unit/Domain/Models/ValueObjects/PrintableCoupon/PrintableCouponCodeTest.php

29 lines
750 B
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\PrintableCoupon;
use Domain\Models\ValueObjects\PrintableCoupon\PrintableCouponCode;
covers(PrintableCouponCode::class);
describe('printable coupon code', function (): void {
it('generates a unique campaign id', function (): void {
// WHEN
$id = PrintableCouponCode::generate();
// THEN
expect($id)->toBeInstanceOf(PrintableCouponCode::class);
});
it('generates different ids on each call', function (): void {
// WHEN
$first = PrintableCouponCode::generate();
$second = PrintableCouponCode::generate();
// THEN
expect((string) $first)->not->toBe((string) $second);
});
});