1
0
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:
Danny van Kooten
2015-11-03 08:03:34 +07:00
parent 97b2ba7daf
commit b0d115431e

View File

@@ -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()
{