diff --git a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php index 3a50a0c1..4db05eeb 100644 --- a/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php +++ b/test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php @@ -111,10 +111,14 @@ 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)(); + $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 +127,7 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void ThreadSafetyMode::NonThreadSafe, 1, null, - null, + new PhpizePath($goodPhpize), ))); putenv('PATH=' . $oldPath);