Skip to content
Open
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions features/cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,44 @@ Feature: `wp cli` tasks
"""
WP-CLI {UPDATE_VERSION}
"""

Scenario: Prevent stable update when PHP version requirement is not met
Given an empty directory
And a new Phar with version "2.8.0"
And that HTTP requests to https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.manifest.json will respond with:
"""
HTTP/1.1 200
Content-Type: application/json

{
"requires_php": "99.0.0"
}
"""

When I try `{PHAR_PATH} cli update --stable --yes`
Then STDERR should contain:
"""
The requested update requires PHP 99.0.0 or higher.
"""
And the return code should be 1

Scenario: Prevent nightly update when PHP version requirement is not met
Given an empty directory
And a new Phar with version "2.8.0"
And that HTTP requests to https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.manifest.json will respond with:
"""
HTTP/1.1 200
Content-Type: application/json

{
"requires_php": "99.0.0"
}
"""

When I try `{PHAR_PATH} cli update --nightly --yes`
Then STDERR should contain:
"""
The requested update requires PHP 99.0.0 or higher.
"""
And the return code should be 1

Loading