mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Fix tests
This commit is contained in:
parent
84973d52f5
commit
ca6577d420
@ -26,21 +26,12 @@ class SwaggerPHPApiComplianceTest extends WebTestCase
|
|||||||
|
|
||||||
public function testAllContextsHaveSameRoot()
|
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();
|
$openApi = $this->getOpenApiDefinition();
|
||||||
$root = $openApi->_context;
|
$root = $openApi->_context;
|
||||||
|
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach ((new Analysis([$openApi], Util::createContext()))->annotations as $annotation) {
|
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)
|
public function assertContextIsConnectedToRootContext(Context $context)
|
||||||
{
|
{
|
||||||
// zircote/swagger-php < 4.2 support
|
$this->assertSame($this->rootContext, $context->root());
|
||||||
$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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getSetupPropertiesWithoutClass(array $setup)
|
private function getSetupPropertiesWithoutClass(array $setup)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user