|
@@ 238-248 (lines=11) @@
|
| 235 |
|
), $this->router->match('/bar/test/do.json', 'GET')); |
| 236 |
|
} |
| 237 |
|
|
| 238 |
|
public function testMatchWithWildcard() |
| 239 |
|
{ |
| 240 |
|
$this->router->map('GET', '/a', 'foo_action', 'foo_route'); |
| 241 |
|
$this->router->map('GET', '*', 'bar_action', 'bar_route'); |
| 242 |
|
|
| 243 |
|
$this->assertEquals(array( |
| 244 |
|
'target' => 'bar_action', |
| 245 |
|
'params' => array(), |
| 246 |
|
'name' => 'bar_route' |
| 247 |
|
), $this->router->match('/everything', 'GET')); |
| 248 |
|
} |
| 249 |
|
|
| 250 |
|
public function testMatchWithCustomRegexp() |
| 251 |
|
{ |
|
@@ 250-261 (lines=12) @@
|
| 247 |
|
), $this->router->match('/everything', 'GET')); |
| 248 |
|
} |
| 249 |
|
|
| 250 |
|
public function testMatchWithCustomRegexp() |
| 251 |
|
{ |
| 252 |
|
$this->router->map('GET', '@^/[a-z]*$', 'bar_action', 'bar_route'); |
| 253 |
|
|
| 254 |
|
$this->assertEquals(array( |
| 255 |
|
'target' => 'bar_action', |
| 256 |
|
'params' => array(), |
| 257 |
|
'name' => 'bar_route' |
| 258 |
|
), $this->router->match('/everything', 'GET')); |
| 259 |
|
|
| 260 |
|
$this->assertFalse($this->router->match('/some-other-thing', 'GET')); |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
public function testMatchWithUnicodeRegex() |
| 264 |
|
{ |