Phprest\Router\RouteCollection::getRoutingTable PHP Метод

getRoutingTable() публичный Метод

public getRoutingTable ( ) : array
Результат array keys: method, route, handler
    public function getRoutingTable()
    {
        return $this->routingTable;
    }

Usage Example

Пример #1
0
 public function testRoutingTable()
 {
     $routingTable = $this->router->getRoutingTable();
     $this->assertCount(2, $routingTable);
     $this->assertEquals('GET', $routingTable[0]['method']);
     $this->assertEquals('\\Phprest\\Stub\\Controller\\Routed::getFoo', $routingTable[0]['handler']);
     $this->assertEquals('/{version:(?:1\\.[2-9])|(?:2\\.[0-8])}/foos/{id}', $routingTable[0]['route']);
     $this->assertEquals('POST', $routingTable[1]['method']);
     $this->assertEquals('\\Phprest\\Stub\\Controller\\Routed::postBar', $routingTable[1]['handler']);
     $this->assertEquals('/{version:(?:0\\.[5-7])}/bars', $routingTable[1]['route']);
 }