34 lines
771 B
PHP
34 lines
771 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Auth;
|
|
|
|
use Uwil\ArcadiaApiPhpClient\Auth\ClientSecret;
|
|
|
|
describe('ClientSecret Test', function () {
|
|
it('can instanciate a valid client secret', function () {
|
|
// GIVEN
|
|
$value = 'valid-client-secret';
|
|
|
|
// WHEN
|
|
$clientSecret = new ClientSecret($value);
|
|
|
|
// THEN
|
|
expect($clientSecret->value)->toBe($value);
|
|
});
|
|
});
|
|
|
|
describe('ClientSecret validation rules', function () {
|
|
it('throws an error with an invalid client secret', function () {
|
|
// GIVEN
|
|
$value = '';
|
|
|
|
// WHEN
|
|
expect(function () use ($value) {
|
|
new ClientSecret($value);
|
|
|
|
// THEN
|
|
})->toThrow(\InvalidArgumentException::class);
|
|
});
|
|
});
|