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