Skip to content
Merged
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
32 changes: 5 additions & 27 deletions features/cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,25 @@ Feature: `wp cli` tasks
"""
And the return code should be 1

Scenario: Update succeeds when sha512 matches even if md5 cannot be accessed
Scenario: Update only verifies the sha512 hash
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.phar.md5 will respond with:
"""
HTTP/1.1 404 Not Found
HTTP/1.1 200 OK
Content-Type: text/plain

Not Found
invalidmd5hash
"""

When I run `{PHAR_PATH} cli update --nightly --yes`
Then STDOUT should contain:
"""
sha512 hash verified:
"""
And STDOUT should contain:
And STDOUT should not contain:
"""
Couldn't access md5 hash for release (HTTP code 404).
md5
"""
And STDOUT should contain:
"""
Expand All @@ -241,28 +241,6 @@ Feature: `wp cli` tasks
And STDERR should be empty
And the return code should be 0

Scenario: Fail update when md5 hash mismatches
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.phar.md5 will respond with:
"""
HTTP/1.1 200 OK
Content-Type: text/plain

invalidmd5hash
"""

When I try `{PHAR_PATH} cli update --nightly --yes`
Then STDERR should contain:
"""
Error: md5 hash for download
"""
And STDERR should contain:
"""
is different than the release hash (invalidmd5hash).
"""
And the return code should be 1

Scenario: Prevent stable update when PHP version requirement is not met
Given an empty directory
And a new Phar with version "2.8.0"
Expand Down
Loading