Skip to content

Commit bdef7dd

Browse files
authored
Merge pull request #836 from dunglas/fix_swagger_cmd_test
Fix SwaggerCommandTest
2 parents ab1fbed + a380d0a commit bdef7dd

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/Bridge/Symfony/Bundle/Command/SwaggerComandTest.php renamed to tests/Bridge/Symfony/Bundle/Command/SwaggerCommandTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,26 @@
1111

1212
namespace ApiPlatform\Core\Tests\Bridge\Symfony\Bundle\Command;
1313

14-
use Nelmio\ApiDocBundle\Tests\WebTestCase;
1514
use Symfony\Bundle\FrameworkBundle\Console\Application;
15+
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1616
use Symfony\Component\Console\Tester\ApplicationTester;
1717

1818
/**
1919
* @author Amrouche Hamza <[email protected]>
2020
*/
21-
class SwaggerComandTest extends WebTestCase
21+
class SwaggerCommandTest extends KernelTestCase
2222
{
2323
public function testExecute()
2424
{
25-
$this->getContainer();
25+
self::bootKernel();
26+
2627
$application = new Application(static::$kernel);
2728
$application->setCatchExceptions(false);
2829
$application->setAutoExit(false);
30+
2931
$tester = new ApplicationTester($application);
30-
$input = [
31-
'command' => 'api:swagger:export',
32-
];
33-
$tester->run($input);
34-
$display = $tester->getDisplay();
35-
$this->assertJson($display);
32+
$tester->run(['command' => 'api:swagger:export']);
33+
34+
$this->assertJson($tester->getDisplay());
3635
}
3736
}

0 commit comments

Comments
 (0)