forked from dcblogdev/laravel-microsoft-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmailFolderUpdateValidatorTest.php
More file actions
28 lines (22 loc) · 928 Bytes
/
EmailFolderUpdateValidatorTest.php
File metadata and controls
28 lines (22 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
use Dcblogdev\MsGraph\Validators\EmailFolderUpdateValidator;
test('valid parameters are accepted', function () {
$response = EmailFolderUpdateValidator::validate([
'displayName' => 'demo',
]);
expect($response)->toEqual([
'displayName' => 'demo',
]);
});
test('throws exception for unrecognized parameters', function () {
EmailFolderUpdateValidator::validate([
'$top' => 10,
]);
})->throws(InvalidArgumentException::class, 'Invalid parameters: $top. Allowed parameters: displayName.');
test('throws exception if displayName is not a string', function () {
EmailFolderUpdateValidator::validate(['displayName' => 1]);
})->throws(InvalidArgumentException::class, 'The displayName must be a string.');
test('allows empty input without throwing an exception', function () {
$response = EmailFolderUpdateValidator::validate([]);
expect($response)->toBe([]);
});