Skip to content

Commit

Permalink
Expect code 255 or 1 since PHP 7 changed some fatals to catchable exc…
Browse files Browse the repository at this point in the history
…eptions
  • Loading branch information
michaelbutler committed Feb 21, 2017
1 parent ae0a5a1 commit d2be081
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/functional/PHPUnitTest.php
Expand Up @@ -203,12 +203,17 @@ public function testRunWithErrorsHasExitCode2()
$this->assertEquals(2, $proc->getExitCode());
}

public function testRunWithFatalParseErrorsHasExitCode255()
/**
* Paratest itself will throw a catchable exception while parsing the unit test before even opening a process and
* running it. In some PHP/library versions, the exception code would be 255. Otherwise, the exception code was 0
* and is manually converted to 1 inside the Symfony Console runner.
*/
public function testRunWithFatalParseErrorsHasExitCode255or1()
{
$proc = $this->invokeParatest('fatal-tests/UnitTestWithFatalParseErrorTest.php', array(
'bootstrap' => BOOTSTRAP
));
$this->assertEquals(255, $proc->getExitCode());
$this->assertTrue(in_array($proc->getExitCode(), [1, 255], true));
}

public function testRunWithFatalRuntimeErrorsHasExitCode1()
Expand Down

0 comments on commit d2be081

Please sign in to comment.