'api.example.com']); } public function testAllContextsHaveSameRoot() { // zircote/swagger-php < 4.2 support $getRootContext = \Closure::bind(function (Context $context) use (&$getRootContext) { if (null !== $context->_parent) { return $getRootContext($context->_parent); } return $context; }, null, Context::class); $openApi = $this->getOpenApiDefinition(); $root = $openApi->_context; $counter = 0; foreach ((new Analysis([$openApi], Util::createContext()))->annotations as $annotation) { $this->assertSame($getRootContext($annotation->_context), $root); } } }