mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-07-30 21:20:20 +02:00
Add tests for non-regex routes, see #100
This commit is contained in:
@@ -273,6 +273,20 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
|
||||
), $this->router->match('/foo/test/do?param=value', 'GET'));
|
||||
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user