From 06e86c8745ff800efadf8bb2f3628d5582394c65 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Wed, 18 Mar 2026 08:27:41 +0000 Subject: [PATCH 1/2] 538: set phpize explicitly on TargetPlatform to ensure it is using the right phpize --- .../unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php index 3a50a0c1..eb570339 100644 --- a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php +++ b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php @@ -115,6 +115,9 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void (fn () => $this->phpBinaryPath = '/path/to/php') ->bindTo($mockPhpBinary, PhpBinaryPath::class)(); + $goodPhpize = realpath(self::GOOD_PHPIZE_PATH . DIRECTORY_SEPARATOR . 'phpize'); + self::assertNotFalse($goodPhpize); + self::assertFalse((new PhpizeBuildToolFinder([]))->check(new TargetPlatform( OperatingSystem::NonWindows, OperatingSystemFamily::Linux, @@ -123,7 +126,7 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void ThreadSafetyMode::NonThreadSafe, 1, null, - null, + new PhpizePath($goodPhpize), ))); putenv('PATH=' . $oldPath); From bb33861b5f4f4e0173703561ef40d81656dacd41 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Wed, 18 Mar 2026 11:59:18 +0000 Subject: [PATCH 2/2] Ensure the phpApiVersion we look for is wildly different from anything in real life, so auto detection does not pick up the real system phpize --- test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php index eb570339..4db05eeb 100644 --- a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php +++ b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php @@ -111,7 +111,8 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void putenv('PATH=' . realpath(self::GOOD_PHPIZE_PATH)); $mockPhpBinary = $this->createMock(PhpBinaryPath::class); - $mockPhpBinary->method('phpApiVersion')->willReturn('20250925'); + // This should not be any API version of a real PHP, otherwise this test might pick up a wrong phpize and false-positive :D + $mockPhpBinary->method('phpApiVersion')->willReturn('30250925'); (fn () => $this->phpBinaryPath = '/path/to/php') ->bindTo($mockPhpBinary, PhpBinaryPath::class)();