Skip to content

Commit

Permalink
Starting tests for RouterRouter::parse()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 27, 2009
1 parent 89d0ed8 commit feb0dec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cake/tests/cases/libs/router.test.php
Expand Up @@ -1980,7 +1980,7 @@ function testRouterConnectDefaults() {

}
}
SimpleTest::ignore('RouterTest');
SimpleTest::ignore('RouterTest');
/**
* Test case for RouterRoute
*
Expand Down Expand Up @@ -2145,6 +2145,21 @@ function testMatching() {
$expected = '/admin/subscriptions/edit/1/';
$this->assertEqual($result, $expected);
}

/**
* test the parse method of RouterRoute.
*
* @return void
*/
function testParse() {
extract(Router::getNamedExpressions());
$route = new RouterRoute('/:controller/:action/:id', array('controller' => 'testing4', 'id' => null), array('id' => $ID));
$route->compile();
$result = $route->parse('/posts/view/1');
$this->assertEqual($result[1], 'posts');
$this->assertEqual($result[2], 'view');
$this->assertEqual($result[3], '1');
}
}


Expand Down

0 comments on commit feb0dec

Please sign in to comment.