Skip to content

Commit fe5657f

Browse files
authored
Fix failing test (#185)
* Fix failing test * Fix unrelated PHPCS issue * Fix typo * Fix incorrect docblock
1 parent 7168319 commit fe5657f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

features/package-install.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,9 @@ Feature: Install WP-CLI packages
10631063
10641064
When I try `wp package install https://example.com/non-existent-zip-asdfasdf.zip`
10651065
Then the return code should be 1
1066-
And STDERR should be:
1066+
And STDERR should contain:
10671067
"""
1068-
Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip' (HTTP code 404).
1068+
Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip'
10691069
"""
10701070
And STDOUT should be empty
10711071

src/Package_Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ private function check_github_package_name( $package_name, $version = '', $insec
11661166
* to false.
11671167
*/
11681168
private function check_git_package_name( $package_name, $url = '', $version = '', $insecure = false ) {
1169-
if ( $url && ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, '[email protected]:' ) !== false ) ) {
1169+
if ( $url && ( ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, '[email protected]:' ) !== false ) ) ) {
11701170
$matches = [];
11711171
preg_match( '#gitlab.com[:/](.*?)\.git#', $url, $matches );
11721172
return $this->check_gitlab_package_name( $matches[1], $version, $insecure );
@@ -1178,7 +1178,7 @@ private function check_git_package_name( $package_name, $url = '', $version = ''
11781178
/**
11791179
* Checks that `$package_name` matches the name in composer.json at GitLab.com, and return corrected value if not.
11801180
*
1181-
* @param string $package_name Package name to check.
1181+
* @param string $project_name Package name to check.
11821182
* @param string $version Optional. Package version. Defaults to empty string.
11831183
* @param bool $insecure Optional. Whether to insecurely retry downloads that failed TLS handshake. Defaults
11841184
* to false.

0 commit comments

Comments
 (0)