public function testRouteMatchingWithOptionalParam() {
$route = new Route(array('template' => '/{:controller}/{:action}'));
$result = $route->match(array('controller' => 'posts'));
$this->assertEqual('/posts', $result);
$result = $route->match(array('controller' => 'users', 'action' => 'index'));
$this->assertEqual('/users', $result);
$result = $route->match(array('controller' => '1'));
$this->assertEqual('/1', $result);
$result = $route->match(array('controller' => '1', 'action' => 'view'));
$this->assertEqual('/1/view', $result);
$result = $route->match(array('controller' => 'users', 'action' => 'view'));
$this->assertEqual('/users/view', $result);
$result = $route->match(array('controller' => 'users', 'action' => 'view', 'id' => '5'));
$this->assertFalse($result);
$result = $route->match(array());
$this->assertFalse($result);
}