Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hamza.simperfit@gmail.com>
*/
class SwaggerComandTest extends WebTestCase
class SwaggerCommandTest extends KernelTestCase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ! I didn't see that in the first place

{
public function testExecute()
{
$this->getContainer();
self::bootKernel();

$application = new Application(static::$kernel);
$application->setCatchExceptions(false);
$application->setAutoExit(false);

$tester = new ApplicationTester($application);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$input = [
'command' => 'api:swagger:export',
];
$tester->run($input);
$display = $tester->getDisplay();
$this->assertJson($display);
$tester->run(['command' => 'api:swagger:export']);

$this->assertJson($tester->getDisplay());
}
}