From 7256d7a8d27744d111f791f0cb8130f36738ceab Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 08:34:37 +0000 Subject: [PATCH] Update `cli update` tests for the removed md5 check `cli update` now only verifies the sha512 hash (wp-cli/wp-cli#6416), so the md5 scenarios no longer apply. Replace them with a scenario that serves a wrong md5 hash and checks that the update succeeds without mentioning md5. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS --- features/cli.feature | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/features/cli.feature b/features/cli.feature index a749632fd..ca3d3a60c 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -214,15 +214,15 @@ 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` @@ -230,9 +230,9 @@ Feature: `wp cli` tasks """ 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: """ @@ -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"