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

37 lines
847 B
PHP
Raw Normal View History

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