@@ -224,10 +224,7 @@ public function testUidBase58KO(string $uid)
224224 }
225225
226226 /**
227- * @testWith ["00000000-0000-0000-0000-000000000000"]
228- * ["ffffffff-ffff-ffff-ffff-ffffffffffff"]
229- * ["01802c4e-c409-9f07-863c-f025ca7766a0"]
230- * ["056654ca-0699-4e16-9895-e60afca090d7"]
227+ * @dataProvider provideUidRfc4122
231228 */
232229 public function testUidRfc4122OK (string $ uid )
233230 {
@@ -238,11 +235,7 @@ public function testUidRfc4122OK(string $uid)
238235 }
239236
240237 /**
241- * @testWith [""]
242- * ["foo"]
243- * ["01802c4e-c409-9f07-863c-f025ca7766a"]
244- * ["01802c4e-c409-9f07-863c-f025ca7766ag"]
245- * ["01802c4ec4099f07863cf025ca7766a0"]
238+ * @dataProvider provideUidRfc4122KO
246239 */
247240 public function testUidRfc4122KO (string $ uid )
248241 {
@@ -252,6 +245,45 @@ public function testUidRfc4122KO(string $uid)
252245 );
253246 }
254247
248+ /**
249+ * @dataProvider provideUidRfc4122
250+ */
251+ public function testUidRfc9562OK (string $ uid )
252+ {
253+ $ this ->assertMatchesRegularExpression (
254+ (new Route ('/{uid} ' , [], ['uid ' => Requirement::UID_RFC9562 ]))->compile ()->getRegex (),
255+ '/ ' .$ uid ,
256+ );
257+ }
258+
259+ /**
260+ * @dataProvider provideUidRfc4122KO
261+ */
262+ public function testUidRfc9562KO (string $ uid )
263+ {
264+ $ this ->assertDoesNotMatchRegularExpression (
265+ (new Route ('/{uid} ' , [], ['uid ' => Requirement::UID_RFC9562 ]))->compile ()->getRegex (),
266+ '/ ' .$ uid ,
267+ );
268+ }
269+
270+ public static function provideUidRfc4122 (): iterable
271+ {
272+ yield ['00000000-0000-0000-0000-000000000000 ' ];
273+ yield ['ffffffff-ffff-ffff-ffff-ffffffffffff ' ];
274+ yield ['01802c4e-c409-9f07-863c-f025ca7766a0 ' ];
275+ yield ['056654ca-0699-4e16-9895-e60afca090d7 ' ];
276+ }
277+
278+ public static function provideUidRfc4122KO (): iterable
279+ {
280+ yield ['' ];
281+ yield ['foo ' ];
282+ yield ['01802c4e-c409-9f07-863c-f025ca7766a ' ];
283+ yield ['01802c4e-c409-9f07-863c-f025ca7766ag ' ];
284+ yield ['01802c4ec4099f07863cf025ca7766a0 ' ];
285+ }
286+
255287 /**
256288 * @testWith ["00000000000000000000000000"]
257289 * ["7ZZZZZZZZZZZZZZZZZZZZZZZZZ"]
0 commit comments