Tag: symfony2

Symfony2 Command Testing

So in the [symfony2 docs](http://symfony.com/doc/master/cookbook/console/console_command.html#testing-commands) it says how to test a command, but never says how to get mock or create a kernel. Here’s the code you that may help you out. use Symfony\Component\Console\Tester\CommandTester; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Acme\DemoBundle\Command\GreetCommand; class ListCommandTest extends WebTestCase { public function testExecute() { $kernel = self::createKernel(); $kernel->boot(); $application =