| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Phprest\Router; |
||
| 7 | public function testGetRoutingTable(): void |
||
| 8 | { |
||
| 9 | $routeCollection = new RouteCollection(); |
||
| 10 | |||
| 11 | $routeCollection->addRoute('GET', '/temperatures', function () { |
||
| 12 | }); |
||
| 13 | $routeCollection->addRoute('GET', '/temperatures/1', function () { |
||
| 14 | }); |
||
| 15 | $routeCollection->addRoute('POST', '/camera', function () { |
||
| 16 | }); |
||
| 17 | |||
| 18 | $this->assertCount(3, $routeCollection->getRoutingTable()); |
||
| 19 | $this->assertEquals('/temperatures', $routeCollection->getRoutingTable()[0]['route']); |
||
| 20 | $this->assertEquals('/temperatures/1', $routeCollection->getRoutingTable()[1]['route']); |
||
| 21 | $this->assertEquals('/camera', $routeCollection->getRoutingTable()[2]['route']); |
||
| 22 | } |
||
| 24 |