Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6d6dd4a

Browse filesBrowse files
committed
minor #57888 [Routing] Add tests for Requirement::UUID_V7 & UuidV8 (smnandre)
This PR was merged into the 7.2 branch. Discussion ---------- [Routing] Add tests for `Requirement::UUID_V7` & `UuidV8` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #... | License | MIT Add tests for Requirement::UUID_V7 & Requirement::UUID_V8 Commits ------- c8e8f8a [Routing] Add tests for `Requirement::UUID_V7` & `UuidV8`
2 parents 5286f27 + c8e8f8a commit 6d6dd4a
Copy full SHA for 6d6dd4a

File tree

Expand file treeCollapse file tree

1 file changed

+58
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+58
-0
lines changed

‎src/Symfony/Component/Routing/Tests/Requirement/RequirementTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/Requirement/RequirementTest.php
+58Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,4 +464,62 @@ public function testUuidV6KO(string $uuid)
464464
'/'.$uuid,
465465
);
466466
}
467+
468+
/**
469+
* @testWith ["00000000-0000-7000-8000-000000000000"]
470+
* ["ffffffff-ffff-7fff-bfff-ffffffffffff"]
471+
* ["01910577-4898-7c47-966e-68d127dde2ac"]
472+
*/
473+
public function testUuidV7OK(string $uuid)
474+
{
475+
$this->assertMatchesRegularExpression(
476+
(new Route('/{uuid}', [], ['uuid' => Requirement::UUID_V7]))->compile()->getRegex(),
477+
'/'.$uuid,
478+
);
479+
}
480+
481+
/**
482+
* @testWith [""]
483+
* ["foo"]
484+
* ["15baaab2-f310-11d2-9ecf-53afc49918d1"]
485+
* ["acd44dc8-d2cc-326c-9e3a-80a3305a25e8"]
486+
* ["7fc2705f-a8a4-5b31-99a8-890686d64189"]
487+
* ["1ecbc991-3552-6920-998e-efad54178a98"]
488+
*/
489+
public function testUuidV7KO(string $uuid)
490+
{
491+
$this->assertDoesNotMatchRegularExpression(
492+
(new Route('/{uuid}', [], ['uuid' => Requirement::UUID_V7]))->compile()->getRegex(),
493+
'/'.$uuid,
494+
);
495+
}
496+
497+
/**
498+
* @testWith ["00000000-0000-8000-8000-000000000000"]
499+
* ["ffffffff-ffff-8fff-bfff-ffffffffffff"]
500+
* ["01910577-4898-8c47-966e-68d127dde2ac"]
501+
*/
502+
public function testUuidV8OK(string $uuid)
503+
{
504+
$this->assertMatchesRegularExpression(
505+
(new Route('/{uuid}', [], ['uuid' => Requirement::UUID_V8]))->compile()->getRegex(),
506+
'/'.$uuid,
507+
);
508+
}
509+
510+
/**
511+
* @testWith [""]
512+
* ["foo"]
513+
* ["15baaab2-f310-11d2-9ecf-53afc49918d1"]
514+
* ["acd44dc8-d2cc-326c-9e3a-80a3305a25e8"]
515+
* ["7fc2705f-a8a4-5b31-99a8-890686d64189"]
516+
* ["1ecbc991-3552-6920-998e-efad54178a98"]
517+
*/
518+
public function testUuidV8KO(string $uuid)
519+
{
520+
$this->assertDoesNotMatchRegularExpression(
521+
(new Route('/{uuid}', [], ['uuid' => Requirement::UUID_V8]))->compile()->getRegex(),
522+
'/'.$uuid,
523+
);
524+
}
467525
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.