Skip to content

Commit

Permalink
Move SAML-specific assertions to saml2-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jul 23, 2024
1 parent aa98f8d commit bc80f10
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 106 deletions.
3 changes: 0 additions & 3 deletions src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@
* @method static void validDuration(mixed $value, string $message = '', string $exception = '')
* @method static void stringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
* @method static void validDateTime(mixed $value, string $message = '', string $exception = '')
* @method static void validDateTimeZulu(mixed $value, string $message = '', string $exception = '')
* @method static void notInArray(mixed $value, array $values, string $message = '', string $exception = '')
* @method static void validURN(mixed $value, string $message = '', string $exception = '')
* @method static void validURI(mixed $value, string $message = '', string $exception = '')
Expand All @@ -321,7 +320,6 @@
* @method static void nullOrValidDuration(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrStringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidDateTime(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidDateTimeZulu(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrNotInArray(mixed $value, array $values, string $message = '', string $exception = '')
* @method static void nullOrValidURN(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidURI(mixed $value, string $message = '', string $exception = '')
Expand All @@ -331,7 +329,6 @@
* @method static void allValidDuration(mixed $value, string $message = '', string $exception = '')
* @method static void allStringPlausibleBase64(mixed $value, string $message = '', string $exception = '')
* @method static void allValidDateTime(mixed $value, string $message = '', string $exception = '')
* @method static void allValidDateTimeZulu(mixed $value, string $message = '', string $exception = '')
* @method static void allNotInArray(mixed $value, array $values, string $message = '', string $exception = '')
* @method static void allValidURN(mixed $value, string $message = '', string $exception = '')
* @method static void allValidURI(mixed $value, string $message = '', string $exception = '')
Expand Down
20 changes: 0 additions & 20 deletions src/CustomAssertionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,6 @@ private static function validDateTime(string $value, string $message = ''): void
}


/**
* @param string $value
* @param string $message
*/
private static function validDateTimeZulu(string $value, string $message = ''): void
{
if (filter_var($value, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => self::$datetime_regex]]) === false) {
throw new InvalidArgumentException(sprintf(
$message ?: '\'%s\' is not a valid xs:dateTime',
$value,
));
} elseif (substr($value, -1) !== 'Z') {
throw new InvalidArgumentException(sprintf(
$message ?: '\'%s\' is not a DateTime expressed in the UTC timezone using the \'Z\' timezone identifier.',
$value,
));
}
}


/**
* @param mixed $value
* @param array<mixed> $values
Expand Down
83 changes: 0 additions & 83 deletions tests/Assert/DateTimeTest.php

This file was deleted.

1 change: 1 addition & 0 deletions tests/Assert/URITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static function provideURI(): array
'spn' => [true, 'spn:a4cf592f-a64c-46ff-a788-b260f474525b'],
'typos' => [true, 'https//www.uni.l/en/'],
'spaces' => [true, 'this is silly'],
'empty' => [true, ''],
];
}

Expand Down

0 comments on commit bc80f10

Please sign in to comment.