options() public method

Add a OPTIONS route
public options ( string $route, mixed $action ) : void
$route string
$action mixed
return void
コード例 #1
0
ファイル: ApplicationTest.php プロジェクト: phprest/phprest
 public function testOptions()
 {
     $this->app->options('/test-options', 'test-handler');
     $this->assertEquals(['method' => 'OPTIONS', 'route' => '/test-options', 'handler' => 'test-handler'], $this->app->getRouter()->getRoutingTable()[0]);
 }