You are here

public function ApplicationTest::testRunWithDispatcher in Zircon Profile 8.0

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

File

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

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

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());
}