public function ApplicationTest::testRunWithDispatcher in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/console/Tests/ApplicationTest.php \Symfony\Component\Console\Tests\ApplicationTest::testRunWithDispatcher()
File
- vendor/
symfony/ console/ Tests/ ApplicationTest.php, line 875
Class
Namespace
Symfony\Component\Console\TestsCode
public function testRunWithDispatcher() {
$application = new Application();
$application
->setAutoExit(false);
$application
->setDispatcher($this
->getDispatcher());
$application
->register('foo')
->setCode(function (InputInterface $input, OutputInterface $output) {
$output
->write('foo.');
});
$tester = new ApplicationTester($application);
$tester
->run(array(
'command' => 'foo',
));
$this
->assertEquals('before.foo.after.' . PHP_EOL, $tester
->getDisplay());
}