I have a test that runs a Symfony 2.0 Command. In the test, I run the Command like this:
$application = new Application(static::$kernel);
$application->add(new MyCommand());
$command = $application->find('mycommand:name');
$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName()));
I want to run the Command with the --no-debug flag, which is a built-in flag to the app:console (I guess?). I've tried:
$commandTester->execute(array('command' => $command->getName(), '--no-debug' => true));
and I've also tried:
$application->run(new StringInput('mycommand:name --no-debug'));
as suggested here. I've tried some other permutations too. But none of them do what I want, which is turn off all the Debug messages in the logs. Is there a way to do what I want in the test?