diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8ebf9925..b9a37d56 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6,7 +6,7 @@ parameters: path: src/Options.php - - message: "#^Parameter \\#7 \\$phpunitOptions of class ParaTest\\\\Options constructor expects array\\, array\\<'bootstrap'\\|'cache\\-directory'\\|'configuration'\\|'coverage\\-filter'\\|'disallow\\-test\\-output'\\|'dont\\-report\\-useless…'\\|'exclude\\-group'\\|'fail\\-on\\-incomplete'\\|'fail\\-on\\-risky'\\|'fail\\-on\\-skipped'\\|'fail\\-on\\-warning'\\|'filter'\\|'group'\\|'no\\-configuration'\\|'order\\-by'\\|'random\\-order\\-seed'\\|'stop\\-on\\-defect'\\|'stop\\-on\\-error'\\|'stop\\-on\\-incomplete'\\|'stop\\-on\\-risky'\\|'stop\\-on\\-skipped'\\|'stop\\-on\\-warning'\\|'strict\\-coverage'\\|'strict\\-global\\-state', non\\-empty\\-array\\|float\\|int\\\\|int\\<1, max\\>\\|non\\-falsy\\-string\\|true\\> given\\.$#" + message: "#^Parameter \\#7 \\$phpunitOptions of class ParaTest\\\\Options constructor expects array\\, array\\<'bootstrap'\\|'cache\\-directory'\\|'configuration'\\|'coverage\\-filter'\\|'disallow\\-test\\-output'\\|'dont\\-report\\-useless…'\\|'exclude\\-group'\\|'fail\\-on\\-incomplete'\\|'fail\\-on\\-risky'\\|'fail\\-on\\-skipped'\\|'fail\\-on\\-warning'\\|'filter'\\|'group'\\|'no\\-configuration'\\|'order\\-by'\\|'process\\-isolation'\\|'random\\-order\\-seed'\\|'stop\\-on\\-defect'\\|'stop\\-on\\-error'\\|'stop\\-on\\-incomplete'\\|'stop\\-on\\-risky'\\|'stop\\-on\\-skipped'\\|'stop\\-on\\-warning'\\|'strict\\-coverage'\\|'strict\\-global\\-state', non\\-empty\\-array\\|float\\|int\\\\|int\\<1, max\\>\\|non\\-falsy\\-string\\|true\\> given\\.$#" count: 1 path: src/Options.php diff --git a/src/Options.php b/src/Options.php index ef6faeb7..76ff4672 100644 --- a/src/Options.php +++ b/src/Options.php @@ -64,6 +64,7 @@ final class Options 'group' => true, 'no-configuration' => true, 'order-by' => true, + 'process-isolation' => true, 'random-order-seed' => true, 'stop-on-defect' => true, 'stop-on-error' => true, @@ -309,11 +310,17 @@ public static function setInputDefinition(InputDefinition $inputDefinition): voi '@see PHPUnit guide, chapter: ' . $chapter, ), new InputOption( - 'strict-coverage', + 'process-isolation', null, InputOption::VALUE_NONE, '@see PHPUnit guide, chapter: ' . $chapter = 'Execution', ), + new InputOption( + 'strict-coverage', + null, + InputOption::VALUE_NONE, + '@see PHPUnit guide, chapter: ' . $chapter, + ), new InputOption( 'strict-global-state', null, diff --git a/test/Unit/WrapperRunner/WrapperRunnerTest.php b/test/Unit/WrapperRunner/WrapperRunnerTest.php index 85f16df5..53a9046e 100644 --- a/test/Unit/WrapperRunner/WrapperRunnerTest.php +++ b/test/Unit/WrapperRunner/WrapperRunnerTest.php @@ -495,4 +495,13 @@ public function testHandleCollisionWithSymfonyOutput(): void $runnerResult = $this->runRunner(); self::assertStringContainsString('', $runnerResult->output); } + + public function testProcessIsolation(): void + { + $this->bareOptions['path'] = $this->fixture('process_isolation' . DIRECTORY_SEPARATOR . 'FooTest.php'); + $this->bareOptions['--process-isolation'] = true; + + $runnerResult = $this->runRunner(); + self::assertEquals(0, $runnerResult->exitCode); + } } diff --git a/test/fixtures/process_isolation/FooTest.php b/test/fixtures/process_isolation/FooTest.php new file mode 100644 index 00000000..83d2c2f4 --- /dev/null +++ b/test/fixtures/process_isolation/FooTest.php @@ -0,0 +1,26 @@ +