From a380d0a70ad47099d02768178239ed729a3f5949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 8 Nov 2016 16:57:06 +0100 Subject: [PATCH] Fix SwaggerCommandTest --- ...gerComandTest.php => SwaggerCommandTest.php} | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename tests/Bridge/Symfony/Bundle/Command/{SwaggerComandTest.php => SwaggerCommandTest.php} (70%) diff --git a/tests/Bridge/Symfony/Bundle/Command/SwaggerComandTest.php b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php similarity index 70% rename from tests/Bridge/Symfony/Bundle/Command/SwaggerComandTest.php rename to tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php index e49c638a4a2..6b0bc7f7b72 100644 --- a/tests/Bridge/Symfony/Bundle/Command/SwaggerComandTest.php +++ b/tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php @@ -11,27 +11,26 @@ namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\Command; -use Nelmio\ApiDocBundle\Tests\WebTestCase; use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Console\Tester\ApplicationTester; /** * @author Amrouche Hamza */ -class SwaggerComandTest extends WebTestCase +class SwaggerCommandTest extends KernelTestCase { public function testExecute() { - $this->getContainer(); + self::bootKernel(); + $application = new Application(static::$kernel); $application->setCatchExceptions(false); $application->setAutoExit(false); + $tester = new ApplicationTester($application); - $input = [ - 'command' => 'api:swagger:export', - ]; - $tester->run($input); - $display = $tester->getDisplay(); - $this->assertJson($display); + $tester->run(['command' => 'api:swagger:export']); + + $this->assertJson($tester->getDisplay()); } }