From e782a9ee7f97bbc4f751324591ec619b5822f721 Mon Sep 17 00:00:00 2001 From: Marcos Passos Date: Tue, 4 Oct 2022 05:14:53 -0300 Subject: [PATCH] Fix UUID pattern (#400) --- src/Matcher/UuidMatcher.php | 2 +- tests/Matcher/UuidMatcherTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Matcher/UuidMatcher.php b/src/Matcher/UuidMatcher.php index d6475ab..4eaa6f5 100644 --- a/src/Matcher/UuidMatcher.php +++ b/src/Matcher/UuidMatcher.php @@ -18,7 +18,7 @@ final class UuidMatcher extends Matcher /** * @var string */ - public const UUID_PATTERN = '[\da-f]{8}-[\da-f]{4}-[1-6][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}'; + public const UUID_PATTERN = '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}'; /** * @var string diff --git a/tests/Matcher/UuidMatcherTest.php b/tests/Matcher/UuidMatcherTest.php index 123e6dd..493d2af 100644 --- a/tests/Matcher/UuidMatcherTest.php +++ b/tests/Matcher/UuidMatcherTest.php @@ -30,6 +30,7 @@ public static function positiveMatchData() ['9f4db639-0e87-4367-9beb-d64e3f42ae18', '@uuid@'], ['1f2b1a18-81a0-5685-bca7-f23022ed7c7b', '@uuid@'], ['1ebb5050-b028-616a-9180-0a00ac070060', '@uuid@'], + ['00000000-0000-0000-0000-000000000000', '@uuid@'], ]; } @@ -53,7 +54,6 @@ public static function negativeMatchData() ['9f4db6390e8743679bebd64e3f42ae18', '@uuid@'], ['9f4db6390e87-4367-9beb-d64e-3f42ae18', '@uuid@'], ['9f4db639-0e87-4367-9beb-d64e3f42ae1g', '@uuid@'], - ['9f4db639-0e87-0367-9beb-d64e3f42ae18', '@uuid@'], ]; }