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