Skip to content

Commit

Permalink
[Routing] Adding a failing test related to URL generation with option…
Browse files Browse the repository at this point in the history
…al parameters
  • Loading branch information
weaverryan committed Jun 3, 2011
1 parent 2093a45 commit c867dcc
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 c867dcc

Please sign in to comment.