When a test 1) executes code that contains an exit; statement and 2) is executed using process isolation then the test is reported as successful:
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class Test extends TestCase
{
public function testOne(): void
{
exit;
}
}
$ phpunit --process-isolation Test
PHPUnit 8.1.3 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 118 ms, Memory: 6.00 MB
OK (1 test, 0 assertions)
The fact that no assertion was performed should at least cause the test to be marked as risky.
The case can be made, though, that a warning should be created for this test as the child process exited before it could properly pass information to the parent process.
Information about aborted child process hidden
What are you up to?!
Constructive feedback and pull requests are always welcome. But comments like "What are you up to?!" with random emojis on top are not helpful, at least not to me. They only serve to rub salt into the wounds that I did not work enough.