Skip to content

Commit f54c866

Browse files
Merge branch '3.4' into 4.1
* 3.4: skip native serialize among child and parent serializable objects [Routing] backport tests from 4.1 Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR Support use of hyphen in asset package name Remove gendered pronouns Replace gender by eye color in tests [Security] dont do nested calls to serialize()
2 parents c948191 + 62f0b8d commit f54c866

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Tests/Matcher/UrlMatcherTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,12 @@ public function testSlashWithVerb()
708708
$this->assertSame(['_route' => 'b'], $matcher->match('/bar/'));
709709

710710
$coll = new RouteCollection();
711-
$coll->add('a', new Route('/dav/{foo<.*>?}', [], [], [], '', [], ['GET', 'OPTIONS']));
711+
$coll->add('a', new Route('/dav/{foo}', [], ['foo' => '.*'], [], '', [], ['GET', 'OPTIONS']));
712712

713713
$matcher = $this->getUrlMatcher($coll, new RequestContext('', 'OPTIONS'));
714714
$expected = [
715715
'_route' => 'a',
716-
'foo' => 'files/bar',
716+
'foo' => 'files/bar/',
717717
];
718718
$this->assertEquals($expected, $matcher->match('/dav/files/bar/'));
719719
}
@@ -743,6 +743,17 @@ public function testSlashAndVerbPrecedence()
743743
$this->assertEquals($expected, $matcher->match('/api/customers/123/contactpersons'));
744744
}
745745

746+
public function testGreedyTrailingRequirement()
747+
{
748+
$coll = new RouteCollection();
749+
$coll->add('a', new Route('/{a}', [], ['a' => '.+']));
750+
751+
$matcher = $this->getUrlMatcher($coll);
752+
753+
$this->assertEquals(['_route' => 'a', 'a' => 'foo'], $matcher->match('/foo'));
754+
$this->assertEquals(['_route' => 'a', 'a' => 'foo/'], $matcher->match('/foo/'));
755+
}
756+
746757
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
747758
{
748759
return new UrlMatcher($routes, $context ?: new RequestContext());

0 commit comments

Comments
 (0)