Skip to content

Commit 2e0ba0a

Browse files
authored
Merge branch 'main' into copilot/enable-xdebug-in-behat-tests-again
2 parents 5446612 + 9c4782b commit 2e0ba0a

35 files changed

Lines changed: 1716 additions & 222 deletions

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Auto detect text files and perform EOL normalization
22
* text=auto eol=lf
33
tests/data/*-win.php eol=crlf
4+
5+
/tests/phpstan export-ignore

‎.github/dependabot.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ updates:
77
open-pull-requests-limit: 10
88
labels:
99
- scope:distribution
10+
cooldown:
11+
default-days: 7
1012
- package-ecosystem: github-actions
1113
directory: "/"
1214
schedule:
1315
interval: daily
1416
open-pull-requests-limit: 10
1517
labels:
1618
- scope:distribution
19+
cooldown:
20+
default-days: 7
1721

‎.github/workflows/copilot-setup-steps.yml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@ on:
99
paths:
1010
- .github/workflows/copilot-setup-steps.yml
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
copilot-setup-steps:
17+
name: Setup environment
1418
runs-on: ubuntu-latest
1519
permissions:
1620
contents: read
1721

1822
steps:
1923
- name: Checkout code
20-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25+
with:
26+
persist-credentials: false
2127

2228
- name: Check existence of composer.json file
2329
id: check_composer_file
2430
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
2531

2632
- name: Set up PHP environment
2733
if: steps.check_composer_file.outputs.files_exists == 'true'
28-
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
34+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
2935
with:
3036
php-version: 'latest'
3137
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -36,9 +42,6 @@ jobs:
3642

3743
- name: Install Composer dependencies & cache dependencies
3844
if: steps.check_composer_file.outputs.files_exists == 'true'
39-
uses: ramsey/composer-install@a35c6ebd3d08125aaf8852dff361e686a1a67947 # v3
45+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
4046
env:
4147
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
42-
with:
43-
# Bust the cache at least once a month - output format: YYYY-MM.
44-
custom-cache-suffix: $(date -u "+%Y-%m")

‎.github/workflows/testing.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,34 @@ on:
1313
jobs:
1414
test:
1515
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main
16+
with:
17+
matrix: |
18+
{
19+
"include": [
20+
{
21+
"php": "8.5",
22+
"wp": "latest",
23+
"mysql": "mysql-8.0",
24+
"os": "macos-15"
25+
},
26+
{
27+
"php": "8.5",
28+
"wp": "latest",
29+
"dbtype": "sqlite",
30+
"os": "macos-15"
31+
},
32+
{
33+
"php": "8.5",
34+
"wp": "latest",
35+
"mysql": "mysql-8.0",
36+
"os": "windows-2025"
37+
},
38+
{
39+
"php": "8.5",
40+
"wp": "latest",
41+
"dbtype": "sqlite",
42+
"os": "windows-2025"
43+
}
44+
],
45+
"exclude": []
46+
}

‎.github/workflows/wp-versions-data-fetcher.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
pull-requests: write
3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3838
with:
3939
ref: ${{ env.ARTIFACTS_BRANCH }}
4040

‎.readme-partials/USING.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ To make use of the WP-CLI testing framework, you need to complete the following
7575
</ruleset>
7676
```
7777
78-
All other [PHPCS configuration options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
78+
All other [PHPCS configuration options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
7979
6. Update your composer dependencies and regenerate your autoloader and binary folders:
8080
```bash
8181
composer update
@@ -202,6 +202,7 @@ The following environment variables can be set to override the default database
202202
- `WP_CLI_TEST_DBUSER` is the user that the tests run under (defaults to "wp_cli_test").
203203
- `WP_CLI_TEST_DBPASS` is the password to use for the above user (defaults to "password1").
204204
- `WP_CLI_TEST_DBTYPE` is the database engine type to use, i.e. "sqlite" for running tests on SQLite instead of MySQL (defaults to "mysql").
205+
- `WP_CLI_TEST_OBJECT_CACHE` is the persistent object cache backend to use. Only supports "sqlite".
205206

206207
Environment variables can be set for the whole session via the following syntax: `export WP_CLI_TEST_DBNAME=custom_db`.
207208

‎README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ To make use of the WP-CLI testing framework, you need to complete the following
8686
</ruleset>
8787
```
8888
89-
All other [PHPCS configuration options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
89+
All other [PHPCS configuration options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset) are, of course, available.
9090
6. Update your composer dependencies and regenerate your autoloader and binary folders:
9191
```bash
9292
composer update
@@ -230,6 +230,7 @@ The following environment variables can be set to override the default database
230230
- `WP_CLI_TEST_DBUSER` is the user that the tests run under (defaults to "wp_cli_test").
231231
- `WP_CLI_TEST_DBPASS` is the password to use for the above user (defaults to "password1").
232232
- `WP_CLI_TEST_DBTYPE` is the database engine type to use, i.e. "sqlite" for running tests on SQLite instead of MySQL (defaults to "mysql").
233+
- `WP_CLI_TEST_OBJECT_CACHE` is the persistent object cache backend to use. Only supports "sqlite".
233234

234235
Environment variables can be set for the whole session via the following syntax: `export WP_CLI_TEST_DBNAME=custom_db`.
235236

@@ -257,8 +258,12 @@ Want to contribute a new feature? Please first [open a new issue](https://github
257258
258259
Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.
259260
261+
### License
262+
263+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
264+
260265
## Support
261266
262-
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support
267+
GitHub issues aren't for general support questions. For support resources and next steps, see the WP-CLI Support page: https://make.wordpress.org/cli/handbook/support/
263268

264269

‎WP_CLI_CS/ruleset.xml‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
To include this ruleset in a WP-CLI project, use `rule ref="WP_CLI_CS"` in brackets.
88
See the instructions in the README/USING for an example.
99
10-
For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
11-
For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
10+
For help using PHPCS: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage
11+
For help understanding this file: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
1212
-->
1313

1414
<!--
@@ -18,7 +18,7 @@
1818
-->
1919

2020
<!-- Ignoring select files/folders for all projects.
21-
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
21+
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
2222
<exclude-pattern>*/.git/*</exclude-pattern>
2323
<exclude-pattern>*/node_modules/*</exclude-pattern>
2424
<exclude-pattern>*/vendor/*</exclude-pattern>
@@ -84,6 +84,26 @@
8484
</rule>
8585

8686

87+
<!--
88+
#############################################################################
89+
USE THE SLEVOMATCODINGSTANDARD RULESET
90+
91+
This checks code for unused `use` statements.
92+
See: https://github.com/slevomat/coding-standard
93+
#############################################################################
94+
-->
95+
96+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
97+
<properties>
98+
<property name="searchAnnotations" value="true"/>
99+
</properties>
100+
<!-- Exclude case-sensitivity check: PHPUnit's @dataProvider annotation uses a
101+
lowercase method name which can cause false positives with the DataProvider
102+
attribute class import (PHPUnit\Framework\Attributes\DataProvider). -->
103+
<exclude name="SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity"/>
104+
</rule>
105+
106+
87107
<!--
88108
#############################################################################
89109
SPECIFIC CONFIGURATION FOR SNIFFS

‎bin/install-package-tests‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ is_numeric() {
1616
esac
1717
}
1818
# Prompt color vars.
19-
C_RED="\033[31m"
20-
C_BLUE="\033[34m"
19+
C_RED="\033[0;31m"
20+
C_BLUE="\033[0;34m"
2121
NO_FORMAT="\033[0m"
2222

2323
HOST=localhost

‎bin/run-behat-tests‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,12 @@ if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/n
134134
fi
135135

136136
# Run the functional tests.
137-
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
137+
FORMAT_ARGS=(--format progress)
138+
for arg in "$@"; do
139+
if [[ "$arg" == "--format"* ]]; then
140+
FORMAT_ARGS=()
141+
break
142+
fi
143+
done
144+
145+
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" "${FORMAT_ARGS[@]}" "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"

0 commit comments

Comments
 (0)