@@ -119,6 +119,35 @@ Here's how to run your tests against the latest trunk version of WordPress:
119119WP_VERSION=trunk composer behat
120120```
121121
122+ #### WordPress Archive
123+
124+ Instead of downloading WordPress from WordPress.org, you can run the tests against an arbitrary
125+ WordPress ZIP archive by setting the `WP_CLI_TEST_CORE_ZIP` environment variable. It accepts either
126+ a path to a local archive or an HTTP(S) URL.
127+
128+ This is useful to test against a WordPress build that has not been released, such as the ZIP file
129+ produced by the WordPress core build process.
130+
131+ ```bash
132+ WP_CLI_TEST_CORE_ZIP=~/Downloads/wordpress.zip composer behat
133+ ```
134+
135+ The archive may contain WordPress at its root, or wrapped in a single folder — both `wordpress/`
136+ (as used by WordPress.org releases) and `build/` (as used by some WordPress core build artifacts)
137+ work. Archives are extracted once and then cached, keyed by their contents.
138+
139+ `WP_VERSION` still determines which version-specific tags (`@require-wp-6.4`, `@less-than-wp-6.4`)
140+ are filtered out, since the version of a development build cannot be compared meaningfully. It
141+ defaults to `trunk` when an archive is set, which runs every scenario. Set it explicitly when the
142+ archive holds a specific release:
143+
144+ ```bash
145+ WP_VERSION=6.4.2 WP_CLI_TEST_CORE_ZIP=~/Downloads/wordpress-6.4.2.zip composer behat
146+ ```
147+
148+ Note that steps requesting an explicit version, such as `Given a WP 6.4.2 installation`, keep
149+ downloading that version from WordPress.org and ignore the archive.
150+
122151#### WP-CLI Binary
123152
124153You can run the tests against a specific WP-CLI binary, instead of using the one that has been built in your project' s ` vendor/bin` folder.
0 commit comments