Skip to content

Commit 6ef07c9

Browse files
Copilotschlessera
andauthored
Use local fixture for remote zip success test
Co-authored-by: schlessera <83631+schlessera@users.noreply.github.com>
1 parent 7ef81ca commit 6ef07c9

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎features/package-install.feature‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,21 +1017,30 @@ Feature: Install WP-CLI packages
10171017
wp-cli/google-sitemap-generator-cli
10181018
"""
10191019
1020-
@github-api
10211020
Scenario: Install a package from a remote zip URL
10221021
Given an empty directory
1022+
And a remote-zip-test-command/composer.json file:
1023+
"""
1024+
{
1025+
"name": "wp-cli-test/remote-zip-test-command",
1026+
"description": "Dummy package served over HTTP as a ZIP archive for acceptance tests.",
1027+
"type": "wp-cli-package"
1028+
}
1029+
"""
1030+
And I run `php -r '$zip = new ZipArchive(); $zip->open( "remote-zip-test-command.zip", ZipArchive::CREATE | ZipArchive::OVERWRITE ); $zip->addFromString( "remote-zip-test-command/composer.json", file_get_contents( "remote-zip-test-command/composer.json" ) ); $zip->close();'`
1031+
And a PHP built-in web server
10231032
1024-
When I run `wp package install https://github.com/wp-cli/google-sitemap-generator-cli/archive/main.zip`
1033+
When I run `wp package install http://localhost:8080/remote-zip-test-command.zip`
10251034
Then STDOUT should contain:
10261035
"""
1027-
Installing package wp-cli/google-sitemap-generator-cli
1036+
Installing package wp-cli-test/remote-zip-test-command
10281037
"""
10291038
And STDOUT should contain:
10301039
"""
10311040
Success: Package installed.
10321041
"""
10331042
1034-
When I run `wp package is-installed wp-cli/google-sitemap-generator-cli`
1043+
When I run `wp package is-installed wp-cli-test/remote-zip-test-command`
10351044
Then the return code should be 0
10361045
And STDERR should be empty
10371046
And STDOUT should be empty

0 commit comments

Comments
 (0)