public function CommandTesterTest::testCommandFromApplication in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/console/Tests/Tester/CommandTesterTest.php \Symfony\Component\Console\Tests\Tester\CommandTesterTest::testCommandFromApplication()
File
- vendor/
symfony/ console/ Tests/ Tester/ CommandTesterTest.php, line 69
Class
Namespace
Symfony\Component\Console\Tests\TesterCode
public function testCommandFromApplication() {
$application = new Application();
$application
->setAutoExit(false);
$command = new Command('foo');
$command
->setCode(function ($input, $output) {
$output
->writeln('foo');
});
$application
->add($command);
$tester = new CommandTester($application
->find('foo'));
// check that there is no need to pass the command name here
$this
->assertEquals(0, $tester
->execute(array()));
}