Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
b67ad2b
try running on other operating systems
swissspidy Oct 2, 2025
ae12662
fixes
swissspidy Oct 2, 2025
761156f
fixes
swissspidy Oct 2, 2025
d8d8eb5
change title
swissspidy Oct 2, 2025
a6c2900
unique by os
swissspidy Oct 2, 2025
ffcdfa1
conditional apt-get
swissspidy Oct 2, 2025
8fef07e
more fixes
swissspidy Oct 2, 2025
3ba9f22
undo string change
swissspidy Oct 2, 2025
981a8ea
Get db version only when needed
swissspidy Oct 2, 2025
d1e8aea
set env var like the others
swissspidy Oct 2, 2025
035a655
use string instead of array
swissspidy Oct 2, 2025
2f6fdb8
pass behat args via step env
swissspidy Oct 3, 2025
cb7887f
Set `WP_CLI_TEST_DBTYPE` for unit tests
swissspidy Oct 3, 2025
ac42de1
No colors on CI
swissspidy Oct 3, 2025
7dc5676
Set db env vars at job level
swissspidy Oct 3, 2025
e368b26
Add output buffer to avoid unexpected output
swissspidy Oct 3, 2025
c20a32c
Add `WP_CLI_TEST_DBTYPE` conditional
swissspidy Oct 3, 2025
04fd1a2
try realpath to see if it helps
swissspidy Oct 3, 2025
8655f8a
Use `curl.exe`
swissspidy Oct 3, 2025
fc0c676
Use `del`
swissspidy Oct 3, 2025
63da4e8
lint fix
swissspidy Oct 3, 2025
98b1583
Use `copy` on windows
swissspidy Oct 3, 2025
a2befaf
Use `mysql.exe`
swissspidy Oct 3, 2025
497c7a7
force del
swissspidy Oct 3, 2025
67bd754
fix copy
swissspidy Oct 3, 2025
d0fb2d2
Use `runner.debug`
swissspidy Oct 3, 2025
30d5882
always pretty for testing
swissspidy Oct 3, 2025
0e3551b
`DIRECTORY_SEPARATOR` all the things
swissspidy Oct 3, 2025
e04fdfe
another realpath
swissspidy Oct 3, 2025
000bd3a
move statement
swissspidy Oct 3, 2025
988caa3
rewrite remove_dir and copy_dir
swissspidy Oct 3, 2025
f7b690f
Replace curl cli with `http_request`
swissspidy Oct 3, 2025
6bf0301
update phpunit config
swissspidy Oct 3, 2025
3456a02
remove method
swissspidy Oct 3, 2025
676c918
undo some changes
swissspidy Oct 3, 2025
d88296b
Cleanup
swissspidy Oct 3, 2025
8f41d68
Add custom matrix
swissspidy Oct 4, 2025
f7c67eb
Add back todo
swissspidy Oct 4, 2025
a071f36
use iterator
swissspidy Oct 4, 2025
d1aada2
Use `taskkill` on Windows
swissspidy Oct 10, 2025
94ba759
second attempt
swissspidy Oct 10, 2025
a3804a6
no grep
swissspidy Oct 10, 2025
4b71eb3
more ai fixes
swissspidy Oct 10, 2025
56c1086
undo color check
swissspidy Oct 12, 2025
4859f9d
Create `wp.bat` on Windows
swissspidy Oct 12, 2025
4dc4bac
Partial revert
swissspidy Oct 12, 2025
3ad0ed8
early return
swissspidy Oct 12, 2025
0a5ab90
Try Windows workaround for unit tests
swissspidy Oct 12, 2025
0f1f277
debugging
swissspidy Oct 12, 2025
a299ad2
DRY unit test
swissspidy Oct 12, 2025
b4a0372
No is_executable check on Windows
swissspidy Oct 12, 2025
2614802
avoid using `grep`
swissspidy Oct 12, 2025
c1be927
more debugging
swissspidy Oct 12, 2025
8182330
More AI fixes
swissspidy Oct 12, 2025
4e1559b
ai debugging
swissspidy Oct 12, 2025
dc0b005
use modified process class
swissspidy Oct 12, 2025
bc16f04
dbg
swissspidy Oct 12, 2025
6f1fdab
AI-suggested fix
swissspidy Oct 12, 2025
8da6b94
sub-process fixes
swissspidy Oct 12, 2025
dc3296a
AI fixes
swissspidy Oct 12, 2025
31285c8
adjust regex
swissspidy Oct 12, 2025
255fab4
Use predetermined mysql binary
swissspidy Oct 12, 2025
8b8f25e
Normalize line endings
swissspidy Oct 12, 2025
6ce7eef
Try behat fixes
swissspidy Oct 12, 2025
530491f
another phpunit attempt
swissspidy Oct 12, 2025
785372b
undo newline change
swissspidy Oct 12, 2025
c5ad367
dir sep
swissspidy Oct 12, 2025
fa97aa6
recursive remove dir
swissspidy Oct 12, 2025
1051290
debug step
swissspidy Oct 12, 2025
1b25dd8
More `DIRECTORY_SEPARATOR`
swissspidy Oct 12, 2025
ad84c65
Avoid using exclamation mark
swissspidy Oct 12, 2025
ae4aff8
Update assertion
swissspidy Oct 12, 2025
b7b0b5c
dir sep
swissspidy Oct 12, 2025
0056f0a
another one
swissspidy Oct 12, 2025
8534057
Try IPv4 resolution on Windows for Composer
swissspidy Oct 12, 2025
7156d96
update docblock
swissspidy Oct 12, 2025
a5cc4d1
Revert "Try IPv4 resolution on Windows for Composer"
swissspidy Oct 12, 2025
134e626
Revert "update docblock"
swissspidy Oct 12, 2025
b44d869
cleanup
swissspidy Oct 12, 2025
0b78aa0
add return type
swissspidy Oct 12, 2025
630f947
Use `main` branch again
swissspidy Oct 13, 2025
196eba3
Restore warning
swissspidy Oct 13, 2025
3805437
Merge branch 'main' into try/os
swissspidy Oct 14, 2025
7b92d18
Temporarily use different branch
swissspidy Oct 22, 2025
596dba3
Revert "Temporarily use different branch"
swissspidy Oct 22, 2025
bbc9046
Use wp-cli main branch
swissspidy Oct 22, 2025
630b4da
Update PHPStan config
swissspidy Oct 22, 2025
e438c09
Update src/Context/FeatureContext.php
swissspidy Nov 24, 2025
2d38a51
Cast to string
swissspidy Nov 24, 2025
835e2b4
Composer: adjust version ranges
swissspidy Oct 28, 2025
da74556
Update file(s) from wp-cli/.github
swissspidy Nov 11, 2025
508b043
Apply some suggestions
swissspidy Nov 24, 2025
3682328
Fix
swissspidy Nov 24, 2025
6cc33eb
Merge branch 'main' into try/os
swissspidy Nov 25, 2025
9ff648c
Add behat tags
swissspidy Nov 25, 2025
c501401
Remove comment
swissspidy Nov 25, 2025
d0d9bda
Merge branch 'main' into try/os
swissspidy Dec 1, 2025
d155f32
Merge branch 'main' into try/os
schlessera Dec 9, 2025
dddbb7a
Merge branch 'main' into try/os
swissspidy Dec 9, 2025
7d23c9e
recursive mkdir
swissspidy Dec 9, 2025
b84aea2
Avoid passing null to `explode`
swissspidy Dec 9, 2025
f7d04a4
Run test only on Linux
swissspidy Dec 9, 2025
ac2dfbc
Skip test for Windows
swissspidy Dec 9, 2025
5e37266
Use PHP_EOL
swissspidy Dec 9, 2025
f138f6b
More skips on windows
swissspidy Dec 9, 2025
e28fa88
Try using `DIRECTORY_SEPARATOR`
swissspidy Dec 9, 2025
13be2f3
Ensure RUN_DIR is defined
swissspidy Dec 9, 2025
e5b7280
Fix relative path check
swissspidy Dec 10, 2025
782e311
Ensure run_dir is set
swissspidy Dec 10, 2025
d6e2506
Revert "Use PHP_EOL"
swissspidy Dec 10, 2025
09a331f
Tweak test
swissspidy Dec 10, 2025
52dec36
Merge branch 'main' into try/os
swissspidy Dec 10, 2025
ef13e97
fix abs path check
swissspidy Dec 10, 2025
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.4",
"wp": "latest",
"mysql": "mysql-8.0",
"os": "macos-15"
},
{
"php": "8.4",
"wp": "latest",
"dbtype": "sqlite",
"os": "macos-15"
},
{
"php": "8.4",
"wp": "latest",
"mysql": "mysql-8.0",
"os": "windows-2025"
},
{
"php": "8.4",
"wp": "latest",
"dbtype": "sqlite",
"os": "windows-2025"
}
],
"exclude": []
}
6 changes: 3 additions & 3 deletions bin/install-package-tests
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ is_numeric() {
*) return 0;; # returns 0 if numeric
esac
}
# Promt color vars.
C_RED="\033[31m"
C_BLUE="\033[34m"
# Prompt color vars.
C_RED="\033[0;31m"
C_BLUE="\033[0;34m"
NO_FORMAT="\033[0m"

HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"wp-cli/config-command": "^1 || ^2",
"wp-cli/core-command": "^1 || ^2",
"wp-cli/eval-command": "^1 || ^2",
"wp-cli/wp-cli": "^2.12",
"wp-cli/wp-cli": "^2.13",
"wp-coding-standards/wpcs": "dev-develop",
"yoast/phpunit-polyfills": "^1.0 || ^2.0 || ^3.0 || ^4.0"
},
Expand Down
22 changes: 14 additions & 8 deletions features/behat-steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Feature: Test that WP-CLI Behat steps work as expected
Then the test-dir directory should not exist

Scenario: Test "Given an empty cache" step
Given an empty cache
Given a WP installation
And an empty cache
Then the {SUITE_CACHE_DIR} directory should exist

Scenario: Test "Given a file" step
Expand All @@ -44,7 +45,8 @@ Feature: Test that WP-CLI Behat steps work as expected
"""

Scenario: Test "Given a cache file" step
Given an empty cache
Given a WP installation
And an empty cache
And a test-cache.txt cache file:
"""
Cached content
Expand Down Expand Up @@ -410,27 +412,31 @@ Feature: Test that WP-CLI Behat steps work as expected

@require-download
Scenario: Test download step
Given an empty cache
Given a WP installation
And an empty cache
And download:
| path | url |
| {SUITE_CACHE_DIR}/test.txt | https://www.iana.org/robots.txt |
Then the {SUITE_CACHE_DIR}/test.txt file should exist

@require-wp @require-composer
# Skipped on Windows because of curl getaddrinfo() errors.
@require-wp @require-composer @skip-windows
Scenario: Test WP installation with Composer
Given a WP installation with Composer
Then the composer.json file should exist
And the vendor directory should exist
When I run `wp core version`
Then STDOUT should not be empty

@require-wp @require-composer
# Skipped on Windows because of curl getaddrinfo() errors.
@require-wp @require-composer @skip-windows
Scenario: Test WP installation with Composer and custom vendor directory
Given a WP installation with Composer and a custom vendor directory 'custom-vendor'
Then the composer.json file should exist
And the custom-vendor directory should exist

@require-wp @require-composer
# Skipped on Windows because of curl getaddrinfo() errors.
@require-wp @require-composer @skip-windows
Scenario: Test dependency on current wp-cli
Given a WP installation with Composer
And a dependency on current wp-cli
Expand All @@ -439,8 +445,7 @@ Feature: Test that WP-CLI Behat steps work as expected
wp-cli/wp-cli
"""



@require-linux
Scenario: Test STDOUT should be empty
When I run `echo -n ""`
Then STDOUT should be empty
Expand Down Expand Up @@ -689,3 +694,4 @@ Feature: Test that WP-CLI Behat steps work as expected
Then STDOUT should be CSV containing:
| user_login | user_email |
| admin | [email protected] |
| user2 | [email protected] |
2 changes: 1 addition & 1 deletion features/steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Feature: Make sure "Given", "When", "Then" steps work as expected
Scenario: Special variables

When I run `echo {INVOKE_WP_CLI_WITH_PHP_ARGS-} cli info`
Then STDOUT should match /wp cli info/
Then STDOUT should match /(wp|wp\.bat) cli info/
And STDERR should be empty

When I run `echo {WP_VERSION-latest}`
Expand Down
7 changes: 6 additions & 1 deletion features/testing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Feature: Test that WP-CLI loads.

Scenario: WP Cron is disabled by default
Given a WP install
And the wp-config.php file should contain:
"""
if ( defined( 'DISABLE_WP_CRON' ) === false ) { define( 'DISABLE_WP_CRON', true ); }
"""
And a test_cron.php file:
"""
<?php
Expand Down Expand Up @@ -53,7 +57,8 @@ Feature: Test that WP-CLI loads.
sqlite
"""

@require-sqlite
# Skipped on Windows because of curl getaddrinfo() errors.
@require-sqlite @skip-windows
Scenario: Composer installation
Given a WP install with Composer

Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ parameters:
- WP_DEBUG_LOG
- WP_DEBUG_DISPLAY
ignoreErrors:
# Needs fixing in WP-CLI.
- message: '#Parameter \#1 \$cmd of function WP_CLI\\Utils\\esc_cmd expects array<string>#'
- message: '#Dynamic call to static method#'
path: 'tests/tests'
strictRules:
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
>
<testsuites>
<testsuite name="default">
<directory prefix="Spec" suffix=".php">tests/</directory>
<directory prefix="Test" suffix=".php">tests/tests</directory>
</testsuite>
</testsuites>
Expand Down
Loading
Loading