Skip to content

Commit 3271b8b

Browse files
authored
Update cli update tests for the removed md5 check (#1152)
1 parent 74bd237 commit 3271b8b

1 file changed

Lines changed: 5 additions & 27 deletions

File tree

‎features/cli.feature‎

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,25 @@ Feature: `wp cli` tasks
214214
"""
215215
And the return code should be 1
216216
217-
Scenario: Update succeeds when sha512 matches even if md5 cannot be accessed
217+
Scenario: Update only verifies the sha512 hash
218218
Given an empty directory
219219
And a new Phar with version "2.8.0"
220220
And that HTTP requests to https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar.md5 will respond with:
221221
"""
222-
HTTP/1.1 404 Not Found
222+
HTTP/1.1 200 OK
223223
Content-Type: text/plain
224224
225-
Not Found
225+
invalidmd5hash
226226
"""
227227
228228
When I run `{PHAR_PATH} cli update --nightly --yes`
229229
Then STDOUT should contain:
230230
"""
231231
sha512 hash verified:
232232
"""
233-
And STDOUT should contain:
233+
And STDOUT should not contain:
234234
"""
235-
Couldn't access md5 hash for release (HTTP code 404).
235+
md5
236236
"""
237237
And STDOUT should contain:
238238
"""
@@ -241,28 +241,6 @@ Feature: `wp cli` tasks
241241
And STDERR should be empty
242242
And the return code should be 0
243243
244-
Scenario: Fail update when md5 hash mismatches
245-
Given an empty directory
246-
And a new Phar with version "2.8.0"
247-
And that HTTP requests to https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar.md5 will respond with:
248-
"""
249-
HTTP/1.1 200 OK
250-
Content-Type: text/plain
251-
252-
invalidmd5hash
253-
"""
254-
255-
When I try `{PHAR_PATH} cli update --nightly --yes`
256-
Then STDERR should contain:
257-
"""
258-
Error: md5 hash for download
259-
"""
260-
And STDERR should contain:
261-
"""
262-
is different than the release hash (invalidmd5hash).
263-
"""
264-
And the return code should be 1
265-
266244
Scenario: Prevent stable update when PHP version requirement is not met
267245
Given an empty directory
268246
And a new Phar with version "2.8.0"

0 commit comments

Comments
 (0)