Inheritance: extends League\Route\RouteCollection
コード例 #1
0
ファイル: ControllerTest.php プロジェクト: phprest/phprest
 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']);
 }
コード例 #2
0
ファイル: Config.php プロジェクト: phprest/phprest
 /**
  * @param StrategyInterface $strategy
  */
 public function setRouterStrategy(StrategyInterface $strategy)
 {
     $this->router->setStrategy($strategy);
 }