|
@@ 144-150 (lines=7) @@
|
| 141 |
|
/** |
| 142 |
|
* @covers Router::generate |
| 143 |
|
*/ |
| 144 |
|
public function testGenerate() |
| 145 |
|
{ |
| 146 |
|
$this->router->map('GET', '/[:controller]/[:action]', $this->closure, 'foo_route'); |
| 147 |
|
|
| 148 |
|
$this->assertEquals('/test/someaction', $this->router->generate('foo_route', $this->param1)); |
| 149 |
|
$this->assertEquals('/test/someaction', $this->router->generate('foo_route', $this->param2)); |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
public function testGenerateWithOptionalUrlParts() |
| 153 |
|
{ |
|
@@ 152-158 (lines=7) @@
|
| 149 |
|
$this->assertEquals('/test/someaction', $this->router->generate('foo_route', $this->param2)); |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
public function testGenerateWithOptionalUrlParts() |
| 153 |
|
{ |
| 154 |
|
$this->router->map('GET', '/[:controller]/[:action].[:type]?', $this->closure, 'bar_route'); |
| 155 |
|
|
| 156 |
|
$this->assertEquals('/test/someaction', $this->router->generate('bar_route', $this->param1)); |
| 157 |
|
$this->assertEquals('/test/someaction.json', $this->router->generate('bar_route', $this->param2)); |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
public function testGenerateWithNonExistingRoute() |
| 161 |
|
{ |