diff --git a/src/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php b/src/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php index 66ba4939d8..6e5e2db9c7 100644 --- a/src/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php +++ b/src/Symfony/Component/Routing/Matcher/ApacheUrlMatcher.php @@ -52,6 +52,7 @@ class ApacheUrlMatcher extends UrlMatcher if ('_route' == $name) { $match = true; + $parameters[$name] = $value; } elseif (0 === strpos($name, '_allow_')) { $allow[] = substr($name, 7); } else { diff --git a/tests/Symfony/Tests/Component/Routing/Matcher/ApacheUrlMatcherTest.php b/tests/Symfony/Tests/Component/Routing/Matcher/ApacheUrlMatcherTest.php new file mode 100644 index 0000000000..81963f0425 --- /dev/null +++ b/tests/Symfony/Tests/Component/Routing/Matcher/ApacheUrlMatcherTest.php @@ -0,0 +1,60 @@ +match($pathinfo, $server); + $this->assertSame(var_export($expect, true), var_export($result, true)); + } + + public function getMatchData() + { + return array( + array( + 'Simple route', + '/hello/world', + array( + '_ROUTING__route' => 'hello', + '_ROUTING__controller' => 'AcmeBundle:Default:index', + '_ROUTING_name' => 'world', + ), + array( + '_route' => 'hello', + '_controller' => 'AcmeBundle:Default:index', + 'name' => 'world', + ), + ), + array( + 'REDIRECT_ envs', + '/hello/world', + array( + 'REDIRECT__ROUTING__route' => 'hello', + 'REDIRECT__ROUTING__controller' => 'AcmeBundle:Default:index', + 'REDIRECT__ROUTING_name' => 'world', + ), + array( + '_route' => 'hello', + '_controller' => 'AcmeBundle:Default:index', + 'name' => 'world', + ), + ), + ); + } +} +