sebastianbergmann / phpunit

The PHP Unit Testing framework.
https://phpunit.de/
BSD 3-Clause "New" or "Revised" License
19.68k stars 2.2k forks source link

Information about aborted child process hidden when process isolation is used #3677

Closed sebastianbergmann closed 1 month ago

sebastianbergmann commented 5 years ago

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.

WebDevTmas commented 4 years ago

Information about aborted child process hidden

What are you up to?!

sebastianbergmann commented 4 years ago

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.

kubawerlos commented 1 month ago

@sebastianbergmann this is no longer happening. I guess it was fixed by https://github.com/sebastianbergmann/phpunit/pull/3968.