Skip to content

Commit

Permalink
Adding a test case for RouterRoute to increase code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 26, 2009
1 parent 3885466 commit 0b9ae92
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cake/tests/cases/libs/router.test.php
Expand Up @@ -2091,6 +2091,15 @@ function testRouteCompilingWithParamPatterns() {
$result = $route->compile();
$this->assertEqual($result, '#^/posts(?:/([0-9]+))(?:\\:([a-z-_]+))(?:/([12][0-9]{3}))[\/]*$#');
$this->assertEqual($route->keys, array('id', 'title', 'year'));

$route =& new RouterRoute(
'/posts/:url_title-(uuid::id)',
array('controller' => 'posts', 'action' => 'view'),
array('pass' => array('id', 'url_title'), 'id' => $ID)
);
$result = $route->compile();
$this->assertEqual($result, '#^/posts(?:/([^\/]+))?(?:-\(uuid\:([0-9]+)\))[\/]*$#');
$this->assertEqual($route->keys, array('url_title', 'id'));
}

/**
Expand All @@ -2112,7 +2121,6 @@ function testMatching() {
$expected = '/admin/subscriptions/edit/1/';
$this->assertEqual($result, $expected);
}

}


Expand Down

0 comments on commit 0b9ae92

Please sign in to comment.