Skip to content

Commit 57fef27

Browse files
committed
Use PHP_BINARY by default in run-tests.php
You pretty much always want to run with -P, make it the default.
1 parent 10e189d commit 57fef27

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

run-tests.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ function main()
160160
$environment["SystemRoot"] = getenv("SystemRoot");
161161
}
162162

163-
// Don't ever guess at the PHP executable location.
164-
// Require the explicit specification.
165-
// Otherwise we could end up testing the wrong file!
166-
167163
$php = null;
168164
$php_cgi = null;
169165
$phpdbg = null;
@@ -461,11 +457,7 @@ function main()
461457
$environment['TEST_PHP_EXECUTABLE'] = $php;
462458
break;
463459
case 'P':
464-
if (constant('PHP_BINARY')) {
465-
$php = PHP_BINARY;
466-
} else {
467-
break;
468-
}
460+
$php = PHP_BINARY;
469461
putenv("TEST_PHP_EXECUTABLE=$php");
470462
$environment['TEST_PHP_EXECUTABLE'] = $php;
471463
break;
@@ -567,7 +559,7 @@ function main()
567559
568560
-p <php> Specify PHP executable to run.
569561
570-
-P Use PHP_BINARY as PHP executable to run.
562+
-P Use PHP_BINARY as PHP executable to run (default).
571563
572564
-q Quiet, no user interaction (same as environment NO_INTERACTION).
573565
@@ -652,6 +644,13 @@ function main()
652644
}
653645
}
654646

647+
// Default to PHP_BINARY as executable
648+
if (!isset($environment['TEST_PHP_EXECUTABLE'])) {
649+
$php = PHP_BINARY;
650+
putenv("TEST_PHP_EXECUTABLE=$php");
651+
$environment['TEST_PHP_EXECUTABLE'] = $php;
652+
}
653+
655654
if (strlen($conf_passed)) {
656655
if (substr(PHP_OS, 0, 3) == "WIN") {
657656
$pass_options .= " -c " . escapeshellarg($conf_passed);

0 commit comments

Comments
 (0)