public function testTypeBasedRouting()
{
Router::connect('/{:controller}/{:id:[0-9]+}', array('action' => 'index', 'type' => 'html', 'id' => null));
Router::connect('/{:controller}/{:id:[0-9]+}.{:type}', array('action' => 'index', 'id' => null));
Router::connect('/{:controller}/{:action}/{:id:[0-9]+}', array('type' => 'html', 'id' => null));
Router::connect('/{:controller}/{:action}/{:id:[0-9]+}.{:type}', array('id' => null));
$url = Router::match(array('controller' => 'posts', 'type' => 'html'));
$this->assertIdentical('/posts', $url);
$url = Router::match(array('controller' => 'posts', 'type' => 'json'));
$this->assertIdentical('/posts.json', $url);
}