| @@ 136-144 (lines=9) @@ | ||
| 133 | * @covers Tight\Router::update |
|
| 134 | * @covers Tight\Router::dispatch |
|
| 135 | */ |
|
| 136 | public function testRouteUpdate() { |
|
| 137 | $output = ""; |
|
| 138 | $this->router->dispatch("/upd/", "update"); |
|
| 139 | $this->expectOutputString($output . "upd"); |
|
| 140 | $output .= "upd"; |
|
| 141 | $this->router->dispatch("/upd/", "get"); |
|
| 142 | $this->expectOutputString($output . "Page not found"); |
|
| 143 | $output .= "Page not found"; |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * @test |
|
| @@ 151-159 (lines=9) @@ | ||
| 148 | * @covers Tight\Router::delete |
|
| 149 | * @covers Tight\Router::dispatch |
|
| 150 | */ |
|
| 151 | public function testRouteDelete() { |
|
| 152 | $output = ""; |
|
| 153 | $this->router->dispatch("/del/", "delete"); |
|
| 154 | $this->expectOutputString($output . "del"); |
|
| 155 | $output .= "del"; |
|
| 156 | $this->router->dispatch("/del/", "post"); |
|
| 157 | $this->expectOutputString($output . "Page not found"); |
|
| 158 | $output .= "Page not found"; |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * @test |
|
| @@ 166-174 (lines=9) @@ | ||
| 163 | * @covers Tight\Route::setMiddleware |
|
| 164 | * @covers Tight\Router::dispatch |
|
| 165 | */ |
|
| 166 | public function testRouteMiddleware() { |
|
| 167 | $output = ""; |
|
| 168 | $this->router->dispatch("/middle/", "get"); |
|
| 169 | $this->expectOutputString($output . "mid1 mid2 end"); |
|
| 170 | $output .= "mid1 mid2 end"; |
|
| 171 | $this->router->dispatch("/middle/", "post"); |
|
| 172 | $this->expectOutputString($output . "Page not found"); |
|
| 173 | $output .= "Page not found"; |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * @test |
|