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