/** * @covers Respect\Rest\Router::dispatchRequest * @covers Respect\Rest\Router::isRoutelessDispatch * @covers Respect\Rest\Router::isDispatchedToGlobalOptionsMethod * @covers Respect\Rest\Router::getAllowedMethods * @runInSeparateProcess */ public function testCanRespondToGlobalOptionsMethodAutomatically() { $router = new Router(); $router->get('/asian', 'Asian Food!'); $router->post('/eastern', 'Eastern Food!'); $router->eat('/mongolian', 'Mongolian Food!'); $response = (string) $router->dispatch('OPTIONS', '*')->response(); $this->assertContains('Allow: GET, POST, EAT', xdebug_get_headers(), 'There should be a sent Allow header with all methods from all routes'); }