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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user