Inheritance: extends League\Route\RouteCollection
Ejemplo n.º 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']);
 }
Ejemplo n.º 2
0
 /**
  * @param StrategyInterface $strategy
  */
 public function setRouterStrategy(StrategyInterface $strategy)
 {
     $this->router->setStrategy($strategy);
 }