ldc-arcadia-genesis-php-client/tests/Unit/Lib/ApiValueObject/IncoIdTest.php

36 lines
747 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Lib\ApiValueObject;
use Uwil\ArcadiaApiPhpClient\Lib\ApiValueObject\IncoId;
describe('IncoId test', function () {
it('can instanciate IncoId', function () {
// GIVEN
$value = '12';
// WHEN
$incoId = new IncoId($value);
// THEN
expect($incoId)->toBeInstanceOf(IncoId::class);
});
});
describe('IncoId validation', function () {
it('throws an exception for invalid code', function (string $dataValue) {
// GIVEN
$value = $dataValue;
// THEN
$this->expectException(\DomainException::class);
// WHEN
new IncoId($value);
})->with([
['invalid'],
[''],
]);
});