-
Notifications
You must be signed in to change notification settings - Fork 180
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
runCommand(): use CommandTester (Enhancement) #219
Comments
yes |
I'll work on it ASAP... |
This would be a cool addition, since with the current Here's what I did: $tester = new CommandTester($this->command);
$this->assertEquals($this->command->getName(), 'my:name');
$this->assertEquals(0, $tester->execute([]));
$output = $tester->getOutput();
$normOutput = $tester->getDisplay() |
I've gave it a go in the PR above. |
I recently updated and got some issues. CommandTester does not dispatch console events and some tests started failing. Is there a solution? |
Are you sure that you're not referencing a different kernel? |
I'm trying to use the
WebTestCase::runCommand()
method.I have yet implemented my unit test to test command, but, as I've anyway extend
WebTestBundle
to load fixtures, I like to also use other useful methods that the bundle provides.So II'd like to rewrite my tests to use those methods.
Now I'm working on a command and seen the code of the method
WebTestCase::runCommand()
.I noted it doesn't use the helpful
Symfony\Component\Console\Tester\CommandTester()
class: is there a reason for this? Or may be theCommandTester
class were released after theWebTestCase::runCommand()
?Can someone help me understand?
The text was updated successfully, but these errors were encountered: