You are here

public function ApplicationTest::testRunWithExceptionAndDispatcher in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/ApplicationTest.php \Symfony\Component\Console\Tests\ApplicationTest::testRunWithExceptionAndDispatcher()

@expectedException \LogicException @expectedExceptionMessage caught

File

vendor/symfony/console/Tests/ApplicationTest.php, line 894

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

public function testRunWithExceptionAndDispatcher() {
  $application = new Application();
  $application
    ->setDispatcher($this
    ->getDispatcher());
  $application
    ->setAutoExit(false);
  $application
    ->setCatchExceptions(false);
  $application
    ->register('foo')
    ->setCode(function (InputInterface $input, OutputInterface $output) {
    throw new \RuntimeException('foo');
  });
  $tester = new ApplicationTester($application);
  $tester
    ->run(array(
    'command' => 'foo',
  ));
}