Skip to content

Commit 9767309

Browse files
authored
Merge pull request #552 from asgrim/538-fix-phpize-build-tool-finder-api-verison-check-test
538: fix phpize build tool finder api verison check test
2 parents b46ed9d + bb33861 commit 9767309

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test/unit/SelfManage/BuildTools/PhpizeBuildToolFinderTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void
111111
putenv('PATH=' . realpath(self::GOOD_PHPIZE_PATH));
112112

113113
$mockPhpBinary = $this->createMock(PhpBinaryPath::class);
114-
$mockPhpBinary->method('phpApiVersion')->willReturn('20250925');
114+
// This should not be any API version of a real PHP, otherwise this test might pick up a wrong phpize and false-positive :D
115+
$mockPhpBinary->method('phpApiVersion')->willReturn('30250925');
115116
(fn () => $this->phpBinaryPath = '/path/to/php')
116117
->bindTo($mockPhpBinary, PhpBinaryPath::class)();
117118

119+
$goodPhpize = realpath(self::GOOD_PHPIZE_PATH . DIRECTORY_SEPARATOR . 'phpize');
120+
self::assertNotFalse($goodPhpize);
121+
118122
self::assertFalse((new PhpizeBuildToolFinder([]))->check(new TargetPlatform(
119123
OperatingSystem::NonWindows,
120124
OperatingSystemFamily::Linux,
@@ -123,7 +127,7 @@ public function testPhpizeForDifferentPhpApiVersionIsRejected(): void
123127
ThreadSafetyMode::NonThreadSafe,
124128
1,
125129
null,
126-
null,
130+
new PhpizePath($goodPhpize),
127131
)));
128132

129133
putenv('PATH=' . $oldPath);

0 commit comments

Comments
 (0)