diff --git a/features/package-install.feature b/features/package-install.feature index df00b828..086d3444 100644 --- a/features/package-install.feature +++ b/features/package-install.feature @@ -1447,6 +1447,43 @@ Feature: Install WP-CLI packages wp-cli/community-command """ + Scenario: Warn with the package name when the GitHub API response cannot be decoded + Given an empty directory + And a mock-github-api.php file: + """ + body ); if ( JSON_ERROR_NONE !== json_last_error() ) { - WP_CLI::warning( "Couldn't fetch default branch for package '%s' (failed to decode JSON response). Presuming default branch is 'master'." ); + WP_CLI::warning( + sprintf( + "Couldn't fetch default branch for package '%s' (failed to decode JSON response). Presuming default branch is 'master'.", + $package_name + ) + ); return 'master'; }