Extends
lithium\test\Unit
Tests that routes can be created with shorthand strings, i.e. `'Controller::action'` and
`array('Controller::action', 'id' => '...')`.
Source
public function testStringParameterConnect() {
Router::connect('/posts/{:id:[0-9a-f]{24}}', 'Posts::edit');
$result = Router::match(array(
'controller' => 'posts', 'action' => 'edit', 'id' => '4bbf25bd8ead0e5180130000'
));
$expected = '/posts/4bbf25bd8ead0e5180130000';
$this->assertEqual($expected, $result);
$ex = "No parameter match found for URL `(";
$ex .= "'controller' => 'posts', 'action' => 'view', 'id' => '4bbf25bd8ead0e5180130000')`.";
$this->expectException($ex);
$result = Router::match(array(
'controller' => 'posts', 'action' => 'view', 'id' => '4bbf25bd8ead0e5180130000'
));
$this->assertFalse(ob_get_length());
}