Skip to content

Commit

Permalink
Add tests for non-regex routes, see #100
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 3, 2015
1 parent 97b2ba7 commit b0d1154
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/AltoRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@ public function testMatch()
), $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()
{
Expand Down

0 comments on commit b0d1154

Please sign in to comment.