From ca4411e433ddcad28629fd0a4c201daef796e132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Wed, 4 Dec 2019 20:13:55 +0100 Subject: [PATCH] Add test for running tests in child process which are calling "exit" --- tests/_files/SeparateProcessesTest.php | 29 +++++++++++++++++++ tests/end-to-end/separate-processes-test.phpt | 17 +++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/_files/SeparateProcessesTest.php create mode 100644 tests/end-to-end/separate-processes-test.phpt diff --git a/tests/_files/SeparateProcessesTest.php b/tests/_files/SeparateProcessesTest.php new file mode 100644 index 00000000000..cbd5054fdd8 --- /dev/null +++ b/tests/_files/SeparateProcessesTest.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +use PHPUnit\Framework\TestCase; + +/** + * @runTestsInSeparateProcesses + */ +class SeparateProcessesTest extends TestCase +{ + public function testFoo(): void + { + $this->assertTrue(true); + exit(0); + } + + public function testBar(): void + { + $this->assertTrue(true); + $this->assertTrue(true); + exit(1); + } +} diff --git a/tests/end-to-end/separate-processes-test.phpt b/tests/end-to-end/separate-processes-test.phpt new file mode 100644 index 00000000000..b4349805d5f --- /dev/null +++ b/tests/end-to-end/separate-processes-test.phpt @@ -0,0 +1,17 @@ +--TEST-- +phpunit --no-configuration ../../_files/SeparateProcessesTest.php +--FILE-- +