Skip to content

Fix SwaggerCommandTest #836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2016
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 <[email protected]>
*/
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());
}
}