Skip to content

Commit 6138b05

Browse files
Copilotswissspidy
andcommitted
Improve test to use WP_CLI_PHP_USED environment variable
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 7250425 commit 6138b05

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

features/cli.feature

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ Feature: `wp cli` tasks
181181
182182
# Create a directory with spaces and a PHP wrapper
183183
When I run `mkdir -p "php with spaces/bin"`
184-
And I run `printf '#!/bin/bash\nexec php "$@"' > "php with spaces/bin/php"`
184+
And I run `cp "$(which php)" "php with spaces/bin/php"`
185185
And I run `chmod +x "php with spaces/bin/php"`
186186
Then the return code should be 0
187187
188-
# Test that the update command works when PHP_BINARY has spaces
189-
When I run `PHP_BINARY="$PWD/php with spaces/bin/php" "$PWD/php with spaces/bin/php" {PHAR_PATH} cli update --yes`
188+
# Test that the update command works when WP_CLI_PHP_USED has spaces
189+
# This simulates the scenario where PHP binary path contains spaces
190+
When I run `WP_CLI_PHP_USED="$PWD/php with spaces/bin/php" {PHAR_PATH} cli update --yes`
190191
Then STDOUT should contain:
191192
"""
192193
sha512 hash verified:

0 commit comments

Comments
 (0)