You are here

public function ApplicationTest::testRunReturnsExitCodeOneForExceptionCodeZero 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::testRunReturnsExitCodeOneForExceptionCodeZero()

File

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

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

public function testRunReturnsExitCodeOneForExceptionCodeZero() {
  $exception = new \Exception('', 0);
  $application = $this
    ->getMock('Symfony\\Component\\Console\\Application', array(
    'doRun',
  ));
  $application
    ->setAutoExit(false);
  $application
    ->expects($this
    ->once())
    ->method('doRun')
    ->will($this
    ->throwException($exception));
  $exitCode = $application
    ->run(new ArrayInput(array()), new NullOutput());
  $this
    ->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
}