ldc-boutique-cnc-sable/tests/Unit/Domain/Models/ValueObjects/EmployeeUpsertDataTest.php
2026-10-27 09:58:12 +01:00

41 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects;
use Carbon\CarbonImmutable;
use Domain\Models\ValueObjects\Code;
use Domain\Models\ValueObjects\EmployeeUpsertData;
use Domain\Models\ValueObjects\Matricule;
describe('EmployeeUpsertData', function (): void {
it('can be instantiated', function (): void {
// GIVEN
$matricule = new Matricule('1234567');
$code = new Code('ABCDEFGH12');
$start = CarbonImmutable::now();
// WHEN
$data = new EmployeeUpsertData(
$matricule,
'Dupont',
'Jean',
'Etab',
'Service',
'Site',
$start,
null,
$code
);
// THEN
expect($data->matricule)->toBe($matricule)
->and($data->nom)->toBe('Dupont')
->and($data->prenom)->toBe('Jean')
->and($data->etablissement)->toBe('Etab')
->and($data->service)->toBe('Service')
->and($data->site)->toBe('Site')
->and($data->startDate)->toBe($start)
->and($data->endDate)->toBeNull()
->and($data->code)->toBe($code);
});
});