From c867dccbed24ad586cd2063ed05a0db4507520fe Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 2 Jun 2011 20:22:33 -0500 Subject: [PATCH] [Routing] Adding a failing test related to URL generation with optional parameters --- .../Tests/Component/Routing/Generator/UrlGeneratorTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php b/tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php index 1a8ed1d79dee..f0ecbe95c617 100644 --- a/tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php +++ b/tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php @@ -184,6 +184,13 @@ public function testSchemeRequirementForcesAbsoluteUrl() $this->assertEquals('http://localhost/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test')); } + public function testNoTrailingSlashForMultipleOptionalParameters() + { + $routes = $this->getRoutes('test', new Route('/category/{slug1}/{slug2}/{slug3}', array('slug2' => null, 'slug3' => null))); + + $this->assertEquals('/app.php/category/foo', $this->getGenerator($routes)->generate('test', array('slug1' => 'foo'))); + } + protected function getGenerator(RouteCollection $routes, array $parameters = array()) { $context = new RequestContext('/app.php');