mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-08-05 07:57:38 +02:00
Add tests for non-regex routes, see #100
This commit is contained in:
@@ -274,6 +274,20 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMatchWithNonRegex() {
|
||||||
|
$this->router->map('GET','/about-us', 'PagesController#about', 'about_us');
|
||||||
|
|
||||||
|
$this->assertEquals(array(
|
||||||
|
'target' => 'PagesController#about',
|
||||||
|
'params' => array(),
|
||||||
|
'name' => 'about_us'
|
||||||
|
), $this->router->match('/about-us', 'GET'));
|
||||||
|
|
||||||
|
$this->assertFalse($this->router->match('/about-us', 'POST'));
|
||||||
|
$this->assertFalse($this->router->match('/about', 'GET'));
|
||||||
|
$this->assertFalse($this->router->match('/about-us-again', 'GET'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testMatchWithFixedParamValues()
|
public function testMatchWithFixedParamValues()
|
||||||
{
|
{
|
||||||
$this->router->map('POST','/users/[i:id]/[delete|update:action]', 'usersController#doAction', 'users_do');
|
$this->router->map('POST','/users/[i:id]/[delete|update:action]', 'usersController#doAction', 'users_do');
|
||||||
|
Reference in New Issue
Block a user