Skip to content

Commit 9641586

Browse files
committed
Fix the version check causing the test fail
1 parent 7670590 commit 9641586

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

sapi/cli/tests/cli_process_title_windows.phpt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,7 @@ if (shell_exec('PowerShell -Help') === NULL)
2020
// Hence on Windows 8, we don't verify that the title is actually set by
2121
// cli_set_process_title(). We're only making the API calls to ensure there are
2222
// no warnings/errors.
23-
24-
$is_windows8_or_above = false;
25-
$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\"");
26-
if ($ps_output === null)
27-
{
28-
echo "Get-Host failed\n";
29-
die();
30-
}
31-
32-
$ps_output = trim($ps_output);
33-
$end_title_windows8 = ": Windows PowerShell";
34-
if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8) || PHP_WINDOWS_VERSION_MAJOR >= 10)
35-
$is_windows8_or_above = true;
23+
$is_windows8_or_above = PHP_WINDOWS_VERSION_MAJOR >= 10 || PHP_WINDOWS_VERSION_MAJOR >= 6 && PHP_WINDOWS_VERSION_MINOR >= 2;
3624

3725
echo "*** Testing setting the process title ***\n";
3826

0 commit comments

Comments
 (0)