Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -123,7 +127,7 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void
ThreadSafetyMode::NonThreadSafe,
1,
null,
null,
new PhpizePath($goodPhpize),
)));

putenv('PATH=' . $oldPath);
Expand Down
Loading