diff --git a/Tests/Functional/SwaggerPHPApiComplianceTest.php b/Tests/Functional/SwaggerPHPApiComplianceTest.php index c09a6d2..23d4a0c 100644 --- a/Tests/Functional/SwaggerPHPApiComplianceTest.php +++ b/Tests/Functional/SwaggerPHPApiComplianceTest.php @@ -26,21 +26,12 @@ class SwaggerPHPApiComplianceTest extends WebTestCase 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); + $this->assertSame($annotation->_context->root(), $root); } } } diff --git a/Tests/SwaggerPhp/UtilTest.php b/Tests/SwaggerPhp/UtilTest.php index 5e392a5..6737fc4 100644 --- a/Tests/SwaggerPhp/UtilTest.php +++ b/Tests/SwaggerPhp/UtilTest.php @@ -822,16 +822,7 @@ class UtilTest extends TestCase public function assertContextIsConnectedToRootContext(Context $context) { - // 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); - - $this->assertSame($this->rootContext, $getRootContext($context)); + $this->assertSame($this->rootContext, $context->root()); } private function getSetupPropertiesWithoutClass(array $setup)