1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-07 17:07:00 +02:00

add failing test for #98

This commit is contained in:
Koen Punt
2014-12-22 12:10:34 +01:00
parent 693752b77a
commit e72248c744

View File

@@ -364,6 +364,37 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
'name' => 'bar_route'
), $this->router->match('/bar/test/do.json', 'GET'));
$this->assertEquals(array(
'target' => 'bar_action',
'params' => array(
'controller' => 'test',
'action' => 'do'
),
'name' => 'bar_route'
), $this->router->match('/bar/test/do', 'GET'));
}
/**
* GitHub #98
*/
public function testMatchWithOptionalPartOnBareUrl(){
$this->router->map('GET', '/[i:page]?', 'bare_action', 'bare_route');
$this->assertEquals(array(
'target' => 'bare_action',
'params' => array(
'page' => 1
),
'name' => 'bare_route'
), $this->router->match('/1', 'GET'));
$this->assertEquals(array(
'target' => 'bare_action',
'params' => array(
),
'name' => 'bare_route'
), $this->router->match('/', 'GET'));
}
public function testMatchWithWildcard()