Skip to content

Commit bc80f10

Browse files
committed
Move SAML-specific assertions to saml2-lib
1 parent aa98f8d commit bc80f10

4 files changed

Lines changed: 1 addition & 106 deletions

File tree

src/Assert.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@
311311
* @method static void validDuration(mixed $value, string $message = '', string $exception = '')
312312
* @method static void stringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
313313
* @method static void validDateTime(mixed $value, string $message = '', string $exception = '')
314-
* @method static void validDateTimeZulu(mixed $value, string $message = '', string $exception = '')
315314
* @method static void notInArray(mixed $value, array $values, string $message = '', string $exception = '')
316315
* @method static void validURN(mixed $value, string $message = '', string $exception = '')
317316
* @method static void validURI(mixed $value, string $message = '', string $exception = '')
@@ -321,7 +320,6 @@
321320
* @method static void nullOrValidDuration(mixed $value, string $message = '', string $exception = '')
322321
* @method static void nullOrStringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
323322
* @method static void nullOrValidDateTime(mixed $value, string $message = '', string $exception = '')
324-
* @method static void nullOrValidDateTimeZulu(mixed $value, string $message = '', string $exception = '')
325323
* @method static void nullOrNotInArray(mixed $value, array $values, string $message = '', string $exception = '')
326324
* @method static void nullOrValidURN(mixed $value, string $message = '', string $exception = '')
327325
* @method static void nullOrValidURI(mixed $value, string $message = '', string $exception = '')
@@ -331,7 +329,6 @@
331329
* @method static void allValidDuration(mixed $value, string $message = '', string $exception = '')
332330
* @method static void allStringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
333331
* @method static void allValidDateTime(mixed $value, string $message = '', string $exception = '')
334-
* @method static void allValidDateTimeZulu(mixed $value, string $message = '', string $exception = '')
335332
* @method static void allNotInArray(mixed $value, array $values, string $message = '', string $exception = '')
336333
* @method static void allValidURN(mixed $value, string $message = '', string $exception = '')
337334
* @method static void allValidURI(mixed $value, string $message = '', string $exception = '')

src/CustomAssertionTrait.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,6 @@ private static function validDateTime(string $value, string $message = ''): void
112112
}
113113

114114

115-
/**
116-
* @param string $value
117-
* @param string $message
118-
*/
119-
private static function validDateTimeZulu(string $value, string $message = ''): void
120-
{
121-
if (filter_var($value, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => self::$datetime_regex]]) === false) {
122-
throw new InvalidArgumentException(sprintf(
123-
$message ?: '\'%s\' is not a valid xs:dateTime',
124-
$value,
125-
));
126-
} elseif (substr($value, -1) !== 'Z') {
127-
throw new InvalidArgumentException(sprintf(
128-
$message ?: '\'%s\' is not a DateTime expressed in the UTC timezone using the \'Z\' timezone identifier.',
129-
$value,
130-
));
131-
}
132-
}
133-
134-
135115
/**
136116
* @param mixed $value
137117
* @param array<mixed> $values

tests/Assert/DateTimeTest.php

Lines changed: 0 additions & 83 deletions
This file was deleted.

tests/Assert/URITest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public static function provideURI(): array
8080
'spn' => [true, 'spn:a4cf592f-a64c-46ff-a788-b260f474525b'],
8181
'typos' => [true, 'https//www.uni.l/en/'],
8282
'spaces' => [true, 'this is silly'],
83+
'empty' => [true, ''],
8384
];
8485
}
8586

0 commit comments

Comments
 (0)