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

37 lines
775 B
PHP
Raw Permalink Normal View History

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