File tree Expand file tree Collapse file tree
test/unit/SelfManage/BuildTools Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments