mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix tests
This commit is contained in:
parent
84973d52f5
commit
ca6577d420
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user