From 305b3413cf8dea533c8f051bdda3fc0b013332f3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 17 Sep 2024 09:52:56 +0200 Subject: [PATCH] Add test covering the fix for #12107, closes #12108 --- tests/Composer/Test/ApplicationTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Composer/Test/ApplicationTest.php b/tests/Composer/Test/ApplicationTest.php index 8e4bce1b5..866892a3b 100644 --- a/tests/Composer/Test/ApplicationTest.php +++ b/tests/Composer/Test/ApplicationTest.php @@ -74,4 +74,16 @@ class ApplicationTest extends TestCase self::assertSame('', $output->fetch()); } + + /** + * @runInSeparateProcess + * @see https://github.com/composer/composer/issues/12107 + */ + public function testProcessIsolationWorksMultipleTimes(): void + { + $application = new Application; + $application->add(new \Composer\Command\AboutCommand); + self::assertSame(0, $application->doRun(new ArrayInput(['command' => 'about']), new BufferedOutput())); + self::assertSame(0, $application->doRun(new ArrayInput(['command' => 'about']), new BufferedOutput())); + } }