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