ldc-cocotte/tests/Integration/WithApp/App/Models/ProductIncoTest.php

25 lines
650 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Integration\WithApp\App\Models;
use App\Models\ProductInco;
use Domain\Models\ValueObjects\IncoId;
describe('ProductInco model', function (): void {
it('returns IncoId value object using no_art instead of surrogate id', function (): void {
// GIVEN
$inco = new ProductInco();
$inco->id = 258;
$inco->no_art = 140317;
// WHEN
$incoId = $inco->getId();
// THEN
expect($incoId)->toBeInstanceOf(IncoId::class)
->and($incoId->value)->toBe(140317)
->and($incoId->value)->not->toBe(258);
});
});