Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f579372
Run tests against Windows & macOS
swissspidy Feb 17, 2026
e2c7bbf
Merge branch 'main' into try/os
swissspidy Mar 10, 2026
e8b7c45
Cherry pick some changes from #6257
swissspidy Mar 10, 2026
fcc8077
Merge branch 'main' into try/os
swissspidy Mar 10, 2026
7637d50
Fix backslashes
swissspidy Mar 10, 2026
176e765
more escaping
swissspidy Mar 10, 2026
9017929
Merge branch 'main' into try/os
swissspidy Mar 10, 2026
15b1a69
tweak more tests
swissspidy Mar 10, 2026
5580d46
Merge branch 'main' into try/os
swissspidy Mar 17, 2026
2d452a0
Use main branch
swissspidy Mar 17, 2026
b714a40
Revert composer.json change
swissspidy Mar 23, 2026
1135a52
Merge branch 'main' into try/os
swissspidy Mar 23, 2026
21e56d2
Some test updates
swissspidy Mar 23, 2026
603ee4e
Merge branch 'main' into try/os
swissspidy Mar 23, 2026
46afcde
Remove leaking test
swissspidy Mar 23, 2026
695aa1f
Harden test
swissspidy Mar 23, 2026
73bdea5
Remove another shaky test
swissspidy Mar 23, 2026
0414dde
Harden tests relying on column width
swissspidy Mar 24, 2026
ffee6b6
Rename `WP_CLI_SKIP_PROMPT` to `WP_CLI_ERROR_RERUN`
swissspidy Mar 24, 2026
864d0e1
Fix tests involving object cache
swissspidy Mar 25, 2026
d359976
Avoid ssh prompt in test
swissspidy Mar 25, 2026
25633c7
use BatchMode=yes
swissspidy Mar 25, 2026
70998ea
Merge branch 'main' into try/os
swissspidy Mar 25, 2026
87f6765
Merge branch 'main' into try/os
swissspidy Mar 26, 2026
6c8202b
Pin GitHub Actions
swissspidy Mar 26, 2026
4430ebe
Update some GitHub Actions
swissspidy Mar 26, 2026
60e2e26
Remove unused file
swissspidy Mar 26, 2026
81955eb
Merge branch 'main' into try/os
swissspidy Mar 26, 2026
092f456
Skip test
swissspidy Mar 27, 2026
ab52bab
Skip some more tests
swissspidy Mar 27, 2026
29ff142
Merge branch 'main' into try/os
swissspidy Mar 27, 2026
c19e383
Skip more suspicious tests
swissspidy Mar 27, 2026
d389b3a
try with debug branch
swissspidy Mar 27, 2026
b38b7de
Revert eval change
swissspidy Mar 27, 2026
3df3cbd
skip more tests on windows
swissspidy Mar 27, 2026
ec5744f
Skip proc_open disabled tests on Windows
swissspidy Mar 27, 2026
46d3fdd
escape dollar
swissspidy Mar 27, 2026
2020334
Pass `WP_CLI_PHP_ARGS` in `wp.bat`
swissspidy Mar 28, 2026
6a62137
temp undo
swissspidy Mar 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,34 @@ on:
jobs:
test:
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main
with:
matrix: |
{
"include": [
{
"php": "8.5",
"wp": "latest",
"mysql": "mysql-8.0",
"os": "macos-15"
},
{
"php": "8.5",
"wp": "latest",
"dbtype": "sqlite",
"os": "macos-15"
},
{
"php": "8.5",
"wp": "latest",
"mysql": "mysql-8.0",
"os": "windows-2025"
},
{
"php": "8.5",
"wp": "latest",
"dbtype": "sqlite",
"os": "windows-2025"
}
],
"exclude": []
}
4 changes: 2 additions & 2 deletions .github/workflows/update-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Get the latest Requests release tag
id: latest_release
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
echo "All modified files are within the allowed paths."
- name: Create pull request
if: steps.latest_release.outputs.tag != steps.current_version.outputs.tag
uses: peter-evans/create-pull-request@v8
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
with:
commit-message: "Update bundled Requests library to ${{ steps.latest_release.outputs.tag }}"
branch: "update/requests-${{ steps.latest_release.outputs.tag }}"
Expand Down
2 changes: 1 addition & 1 deletion bin/wp.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@ECHO OFF
php "%~dp0../php/boot-fs.php" %*
php %WP_CLI_PHP_ARGS% "%~dp0../php/boot-fs.php" %*
6 changes: 0 additions & 6 deletions dependencies.yml

This file was deleted.

22 changes: 17 additions & 5 deletions features/aliases.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Feature: Create shortcuts to specific WordPress installs
unknown --path parameter
"""

When I run `wp @foo eval 'echo get_current_user_id();' --user=admin`
When I run `wp @foo eval "echo get_current_user_id();" --user=admin`
Then STDOUT should be:
"""
1
Expand All @@ -83,13 +83,13 @@ Feature: Create shortcuts to specific WordPress installs
user: admin
"""

When I run `wp @foo eval 'echo get_current_user_id();'`
When I run `wp @foo eval "echo get_current_user_id();"`
Then STDOUT should be:
"""
1
"""

When I try `wp @foo eval 'echo get_current_user_id();' --user=admin`
When I try `wp @foo eval "echo get_current_user_id();" --user=admin`
Then STDERR should contain:
"""
Parameter errors:
Expand Down Expand Up @@ -174,6 +174,7 @@ Feature: Create shortcuts to specific WordPress installs
Error: No alias found with key '@someotherfoo'.
"""

@skip-windows @skip-macos
Scenario: Adds proxyjump to ssh command
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -189,6 +190,7 @@ Feature: Create shortcuts to specific WordPress installs
Running SSH command: ssh -J 'proxyhost' -T -vvv
"""

@skip-windows @skip-macos
Scenario: Adds key to ssh command
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -204,6 +206,7 @@ Feature: Create shortcuts to specific WordPress installs
Running SSH command: ssh -i 'identityfile.key' -T -vvv
"""

@skip-windows @skip-macos
Scenario: Vagrant SSH disables strict host key checking
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -218,6 +221,7 @@ Feature: Create shortcuts to specific WordPress installs
Running SSH command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -T -vvv '' 'wp --debug --version'
"""

@skip-windows @skip-macos
Scenario: SSH alias expands tilde in path
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -236,6 +240,7 @@ Feature: Create shortcuts to specific WordPress installs
sites/example.com/www
"""

@skip-windows @skip-macos
Scenario: Connection-specific properties are not passed to remote WP-CLI
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -256,6 +261,7 @@ Feature: Create shortcuts to specific WordPress installs
WP_CLI_RUNTIME_ALIAS
"""

@skip-windows @skip-macos
Scenario: WordPress-specific properties are passed to remote WP-CLI
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -276,6 +282,7 @@ Feature: Create shortcuts to specific WordPress installs
@foo
"""

@skip-windows @skip-macos
Scenario: SSH commands should not be double-escaped
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -290,6 +297,7 @@ Feature: Create shortcuts to specific WordPress installs
Running SSH command: ssh -T -vvv 'user@host' 'cd '\''/path/to/wordpress'\''; wp plugin list --debug'
"""

@skip-windows @skip-macos
Scenario: SSH commands correctly escape arguments with spaces
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -304,6 +312,7 @@ Feature: Create shortcuts to specific WordPress installs
Running SSH command: ssh -T -vvv 'user@host' 'cd '\''/path/to/wordpress'\''; wp post create --post_title=My Title
"""

@skip-windows @skip-macos
Scenario: Uses env command for runtime alias with separate path line
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand All @@ -323,6 +332,7 @@ Feature: Create shortcuts to specific WordPress installs
wp @foo
"""

@skip-windows @skip-macos
Scenario: Two aliases with same SSH host but different paths generate different remote commands
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand Down Expand Up @@ -355,6 +365,7 @@ Feature: Create shortcuts to specific WordPress installs
\/path\/to\/production
"""

@skip-windows @skip-macos
Scenario: Properly escapes single quotes in runtime alias path
Given a WP installation in 'foo'
And a wp-cli.yml file:
Expand Down Expand Up @@ -755,6 +766,7 @@ Feature: Create shortcuts to specific WordPress installs
--alias=bar core is-installed --allow-root --debug
"""

@skip-windows
Scenario Outline: Check that proc_open() and proc_close() aren't disabled for grouped aliases
Given a WP installation in 'foo'
And a WP installation in 'bar'
Expand Down Expand Up @@ -1138,7 +1150,7 @@ Feature: Create shortcuts to specific WordPress installs
path: bar
"""

When I run `wp @all eval 'echo "output-from-alias\n";'`
When I run `wp @all eval "echo 'output-from-alias' . PHP_EOL;"`
Then STDOUT should be:
"""
@foo
Expand All @@ -1147,7 +1159,7 @@ Feature: Create shortcuts to specific WordPress installs
output-from-alias
"""

When I run `wp @all eval 'echo "output-from-alias\n";' --quiet`
When I run `wp @all eval "echo 'output-from-alias' . PHP_EOL;" --quiet`
Then STDOUT should be:
"""
output-from-alias
Expand Down
13 changes: 7 additions & 6 deletions features/bootstrap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Feature: Bootstrap WP-CLI
"""
And I run `composer install --no-interaction 2>&1`

When I run `vendor/bin/wp eval '\WP_CLI::Success( "WP-Standard-Eval" );'`
When I run `vendor/bin/wp eval "\WP_CLI::Success( 'WP-Standard-Eval' );"`
Then STDOUT should contain:
"""
Success: WP-Override-Eval
Expand Down Expand Up @@ -165,7 +165,7 @@ Feature: Bootstrap WP-CLI
WP-CLI
"""

When I run `wp eval '\WP_CLI::Success( "WP-Standard-Eval" );'`
When I run `wp eval "\WP_CLI::Success( 'WP-Standard-Eval' );"`
Then STDOUT should contain:
"""
Success: WP-Standard-Eval
Expand All @@ -177,7 +177,7 @@ Feature: Bootstrap WP-CLI
WP-Override-CLI
"""

When I run `wp --require=override/override.php eval '\WP_CLI::Success( "WP-Standard-Eval" );'`
When I run `wp --require=override/override.php eval "\WP_CLI::Success( 'WP-Standard-Eval' );"`
Then STDOUT should contain:
"""
Success: WP-Override-Eval
Expand Down Expand Up @@ -253,7 +253,7 @@ Feature: Bootstrap WP-CLI
WP-CLI
"""

When I run `wp eval '\WP_CLI::Success( "WP-Standard-Eval" );' --skip-packages`
When I run `wp eval "\WP_CLI::Success( 'WP-Standard-Eval' );" --skip-packages`
Then STDOUT should contain:
"""
Success: WP-Standard-Eval
Expand All @@ -265,7 +265,7 @@ Feature: Bootstrap WP-CLI
WP-Override-CLI
"""

When I run `wp eval '\WP_CLI::Success( "WP-Standard-Eval" );'`
When I run `wp eval "\WP_CLI::Success( 'WP-Standard-Eval' );"`
Then STDOUT should contain:
"""
Success: WP-Override-Eval
Expand Down Expand Up @@ -397,7 +397,7 @@ Feature: Bootstrap WP-CLI
"""
And the return code should be 0

When I run `wp eval 'echo constant( "WP_CLI_TEST_CONSTANT" );'`
When I run `wp eval "echo constant( 'WP_CLI_TEST_CONSTANT' );"`
Then STDOUT should be:
"""
foo
Expand Down Expand Up @@ -499,6 +499,7 @@ Feature: Bootstrap WP-CLI
"""
And the return code should be 0

@skip-windows
Scenario: Allow disabling ini_set()
Given an empty directory
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=ini_set} cli info`
Expand Down
3 changes: 2 additions & 1 deletion features/class-wp-cli.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Feature: Various utilities for WP-CLI commands

@skip-windows
Scenario Outline: Check that `proc_open()` and `proc_close()` aren't disabled for `WP_CLI::launch()`
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=<func>} --skip-wordpress eval 'WP_CLI::launch( null );'`
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--ddisable_functions=<func>} --skip-wordpress eval "WP_CLI::launch( null );"`
Then STDERR should contain:
"""
Error: Cannot do 'launch': The PHP functions `proc_open()` and/or `proc_close()` are disabled
Expand Down
14 changes: 7 additions & 7 deletions features/cli-cache.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Feature: CLI Cache
Scenario: Remove all files from cache directory
Given an empty cache

When I run `wp core download --path={CACHE_DIR} --version=4.9 --force`
And I run `wp core download --path={CACHE_DIR} --version=4.9 --force --locale=de_DE`
When I run `wp core download --path={CACHE_DIR} --version=6.9 --force`
And I run `wp core download --path={CACHE_DIR} --version=6.9 --force --locale=de_DE`
Then the {SUITE_CACHE_DIR}/core directory should contain:
"""
wordpress-4.9-de_DE.tar.gz
wordpress-4.9-en_US.tar.gz
wordpress-6.9-de_DE.tar.gz
wordpress-6.9-en_US.tar.gz
"""

When I run `wp cli cache clear`
Expand All @@ -19,11 +19,11 @@ Feature: CLI Cache
And STDERR should be empty
And the {SUITE_CACHE_DIR}/core directory should not contain:
"""
wordpress-4.9-de_DE.tar.gz
wordpress-6.9-de_DE.tar.gz
"""
And the {SUITE_CACHE_DIR}/core directory should not contain:
"""
wordpress-4.9-en_US.tar.gz
wordpress-6.9-en_US.tar.gz
"""

Scenario: Using a null device disables the cache without throwing an error
Expand All @@ -34,7 +34,7 @@ Feature: CLI Cache
putenv( 'WP_CLI_CACHE_DIR=/dev/null' );
"""

When I run `wp --require=env-var.php core download --path=/tmp/wp-core --version=4.9 --force`
When I run `wp --require=env-var.php core download --path=/tmp/wp-core --version=6.9 --force`
Then STDERR should be empty

Scenario: Remove all but newest files from cache directory
Expand Down
6 changes: 3 additions & 3 deletions features/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Feature: Have a config file
"""

# Arbitrary values should be passed, without warnings
When I run `wp eval 'echo json_encode( $assoc_args );'`
When I run `wp eval "echo json_encode( \$assoc_args );"`
Then STDOUT should be JSON containing:
"""
{"foo": "bar"}
Expand Down Expand Up @@ -750,13 +750,13 @@ Feature: Have a config file
Error: Strange wp-config.php file: wp-settings.php is not loaded directly.
"""

When I run `wp eval 'var_export( defined("MY_CONSTANT") );'`
When I run `wp eval "var_export( defined('MY_CONSTANT') );"`
Then STDOUT should be:
"""
true
"""

When I run `wp eval 'var_export( defined("MY_OTHER_CONSTANT") );'`
When I run `wp eval "var_export( defined('MY_OTHER_CONSTANT') );"`
Then STDOUT should be:
"""
true
Expand Down
Loading
Loading