| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class RouterTest extends TestCase |
||
| 11 | { |
||
| 12 | private Router $router; |
||
| 13 | |||
| 14 | protected function setUp(): void |
||
| 15 | { |
||
| 16 | $this->router = Router::withServer([ |
||
| 17 | 'REQUEST_METHOD' => 'GET', |
||
| 18 | 'REQUEST_URI' => '/foo/?bar=123', |
||
| 19 | ]); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function test_404_no_route_found(): void |
||
| 27 | } |
||
| 28 | |||
| 29 | public function test_static_get_route_found(): void |
||
| 30 | { |
||
| 31 | $this->router->get('/foo', static function (): void { |
||
| 32 | echo 'route found'; |
||
| 33 | }); |
||
| 34 | |||
| 35 | $this->router->listen(); |
||
| 36 | |||
| 37 | $this->expectOutputString('route found'); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function test_dynamic_get_route_found(): void |
||
| 49 | } |
||
| 50 | } |
||
| 51 |