From 10bc4662d8dd6dc5e14d8557d711fc26c0058719 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 5 Apr 2024 09:32:08 +0200 Subject: [PATCH 1/4] Fix failing test --- features/package-install.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/package-install.feature b/features/package-install.feature index 45a94a80..21a899e6 100644 --- a/features/package-install.feature +++ b/features/package-install.feature @@ -1063,9 +1063,9 @@ Feature: Install WP-CLI packages When I try `wp package install https://example.com/non-existent-zip-asdfasdf.zip` Then the return code should be 1 - And STDERR should be: + And STDERR should cintain: """ - Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip' (HTTP code 404). + Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip' """ And STDOUT should be empty From ad3df0c8a2a3aa6c86b3145381ea5162579877be Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 5 Apr 2024 09:36:03 +0200 Subject: [PATCH 2/4] Fix unrelated PHPCS issue --- src/Package_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Package_Command.php b/src/Package_Command.php index e86d1d89..a486250b 100644 --- a/src/Package_Command.php +++ b/src/Package_Command.php @@ -1166,7 +1166,7 @@ private function check_github_package_name( $package_name, $version = '', $insec * to false. */ private function check_git_package_name( $package_name, $url = '', $version = '', $insecure = false ) { - if ( $url && ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, 'git@gitlab.com:' ) !== false ) ) { + if ( $url && ( ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, 'git@gitlab.com:' ) !== false ) ) ) { $matches = []; preg_match( '#gitlab.com[:/](.*?)\.git#', $url, $matches ); return $this->check_gitlab_package_name( $matches[1], $version, $insecure ); From 5c3216b477768173d1d5c0219d6c22a47ddb03e2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 5 Apr 2024 09:36:16 +0200 Subject: [PATCH 3/4] Fix typo --- features/package-install.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/package-install.feature b/features/package-install.feature index 21a899e6..b2290444 100644 --- a/features/package-install.feature +++ b/features/package-install.feature @@ -1063,7 +1063,7 @@ Feature: Install WP-CLI packages When I try `wp package install https://example.com/non-existent-zip-asdfasdf.zip` Then the return code should be 1 - And STDERR should cintain: + And STDERR should contain: """ Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip' """ From d767bbd206690a29426ccfceeeea03f7ffc553b8 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 5 Apr 2024 09:36:57 +0200 Subject: [PATCH 4/4] Fix incorrect docblock --- src/Package_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Package_Command.php b/src/Package_Command.php index a486250b..d8c8e7bb 100644 --- a/src/Package_Command.php +++ b/src/Package_Command.php @@ -1178,7 +1178,7 @@ private function check_git_package_name( $package_name, $url = '', $version = '' /** * Checks that `$package_name` matches the name in composer.json at GitLab.com, and return corrected value if not. * - * @param string $package_name Package name to check. + * @param string $project_name Package name to check. * @param string $version Optional. Package version. Defaults to empty string. * @param bool $insecure Optional. Whether to insecurely retry downloads that failed TLS handshake. Defaults * to false.