From c6bbaecc54888426425d0be0b048a784b51d8ec3 Mon Sep 17 00:00:00 2001 From: Guilhem N Date: Fri, 18 Nov 2016 22:16:53 +0100 Subject: [PATCH] Fix tests --- Describer/ApiPlatformDescriber.php | 4 ++-- Tests/Functional/FunctionalTest.php | 2 +- Tests/Functional/TestKernel.php | 2 ++ composer.json | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Describer/ApiPlatformDescriber.php b/Describer/ApiPlatformDescriber.php index 499a6df..2dd12c0 100644 --- a/Describer/ApiPlatformDescriber.php +++ b/Describer/ApiPlatformDescriber.php @@ -12,14 +12,14 @@ namespace EXSyst\Bundle\ApiDocBundle\Describer; use ApiPlatform\Core\Documentation\Documentation; -use ApiPlatform\Core\Swagger\DocumentationNormalizer; +use ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer; class ApiPlatformDescriber extends ExternalDocDescriber { public function __construct(Documentation $documentation, DocumentationNormalizer $normalizer, bool $overwrite = false) { parent::__construct(function () use ($documentation, $normalizer) { - return $normalizer->normalize($documentation); + return (array) $normalizer->normalize($documentation); }, $overwrite); } } diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index b69c747..df8e041 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -66,7 +66,7 @@ class FunctionalTest extends WebTestCase { static::createClient(); - return static::$kernel->getContainer()->get('exsyst_api_doc.generator')->extract(); + return static::$kernel->getContainer()->get('exsyst_api_doc.generator')->generate(); } private function getOperation($path, $method) diff --git a/Tests/Functional/TestKernel.php b/Tests/Functional/TestKernel.php index 40a89a1..7b7b110 100644 --- a/Tests/Functional/TestKernel.php +++ b/Tests/Functional/TestKernel.php @@ -15,6 +15,7 @@ use EXSyst\Bundle\ApiDocBundle\Tests\Functional\TestBundle; use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; +use Symfony\Bundle\TwigBundle\TwigBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel; @@ -31,6 +32,7 @@ class TestKernel extends Kernel { return [ new FrameworkBundle(), + new TwigBundle(), new SensioFrameworkExtraBundle(), new ApiPlatformBundle(), new EXSystApiDocBundle(), diff --git a/composer.json b/composer.json index c1ad59e..9236a28 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,8 @@ "exsyst/swagger": "~0.2.1" }, "require-dev": { + "symfony/twig-bundle": "^3.2", + "symfony/config": "^3.2", "symfony/validator": "^3.2", "symfony/property-access": "^3.2", "symfony/browser-kit": "^3.2",