Skip to content

Commit

Permalink
Add test to expose wildcard bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
switchplane-tom committed Jun 23, 2023
1 parent b2d82a8 commit 3c5e3ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ public function process(

public function testGetPathReplacesWildcards(): void
{
$route = new Route('GET', '/a/{wildcard}/and/{wildcardWithMatcher:uuid}', static function () {
$route = new Route('GET', '/a/{wildcard}/and/{wildcardWithMatcher:uuid}/and/{wildcardWithMatcherAgain:uuid}', static function () {
});

$path = $route->getPath([
'wildcard' => 'replaced-wildcard',
'wildcardWithMatcher' => 'replaced-wildcard-with-matcher',
'wildcard' => 'replaced-wildcard',
'wildcardWithMatcher' => 'replaced-wildcard-with-matcher',
'wildcardWithMatcherAgain' => 'replaced-wildcard-with-matcher-again',
]);

$this->assertSame('/a/replaced-wildcard/and/replaced-wildcard-with-matcher', $path);
$this->assertSame('/a/replaced-wildcard/and/replaced-wildcard-with-matcher/and/replaced-wildcard-with-matcher-again', $path);
}

public function testGetPathReplacesOptional(): void
Expand Down

0 comments on commit 3c5e3ae

Please sign in to comment.