Skip to content

Commit

Permalink
Merge remote branch 'weaverryan/router_generator_failing_test'
Browse files Browse the repository at this point in the history
* weaverryan/router_generator_failing_test:
  [Routing] Adding a failing test related to URL generation with optional parameters
  • Loading branch information
fabpot committed Jun 3, 2011
2 parents 79c6dc7 + c867dcc commit 79a611f
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -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');
Expand Down

0 comments on commit 79a611f

Please sign in to comment.