You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4db452c
Browse filesBrowse the repository at this point in the historyBrowse files
When I run `wp --require=bad-command.php package list`
62
62
Then STDERR should be empty
63
63
64
-
@require-php-7.2@broken
65
-
Scenario: Revert the WP-CLI packages composer.json when fail to install/uninstall a package due to memory limit
64
+
Scenario: Revert composer.json when Composer cannot resolve an install or uninstall
66
65
Given an empty directory
67
-
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package install runcommand/hook`
66
+
67
+
When I run `wp package list --skip-update-check`
68
+
And I run `wp package path`
69
+
Then save STDOUT as {PACKAGE_PATH}
70
+
71
+
When I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
72
+
Then save STDOUT as {COMPOSER_JSON_MD5}
73
+
74
+
When I try `wp package install runcommand/hook:999999.0.0`
68
75
Then the return code should not be 0
69
76
And STDERR should contain:
70
77
"""
71
78
Reverted composer.json.
72
79
"""
73
80
74
-
When I run `wp package install runcommand/hook`
75
-
Then STDOUT should contain:
81
+
When I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
82
+
Then STDOUT should be:
76
83
"""
77
-
Success: Package installed.
84
+
{COMPOSER_JSON_MD5}
78
85
"""
79
86
80
-
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package uninstall runcommand/hook`
81
-
Then the return code should not be 0
82
-
And STDERR should contain:
87
+
Given a kept/composer.json file:
83
88
"""
84
-
Reverted composer.json.
89
+
{"name":"local/kept","version":"1.0.0"}
90
+
"""
91
+
When I run `wp package install ./kept`
92
+
And I run `wp package install runcommand/hook`
93
+
Then STDOUT should contain:
94
+
"""
95
+
Success: Package installed.
85
96
"""
86
97
87
-
# Create a default composer.json first to compare.
88
-
When I run `WP_CLI_PACKAGES_DIR={RUN_DIR}/mypackages wp package list`
89
-
Then the {RUN_DIR}/mypackages/composer.json file should exist
90
-
And save the {RUN_DIR}/mypackages/composer.json file as {MYPACKAGES_COMPOSER_JSON}
98
+
When I run `wp eval "file_put_contents( '{PACKAGE_PATH}/composer.json', str_replace( '1.0.0', '999999.0.0', file_get_contents( '{PACKAGE_PATH}/composer.json' ) ) );" --skip-wordpress`
99
+
And I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
100
+
Then save STDOUT as {COMPOSER_JSON_MD5}
91
101
92
-
When I try `WP_CLI_PACKAGES_DIR={RUN_DIR}/mypackages {INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package install runcommand/hook`
102
+
When I try `wp package uninstall runcommand/hook`
93
103
Then the return code should not be 0
94
104
And STDERR should contain:
95
105
"""
96
106
Reverted composer.json.
97
107
"""
98
-
And the mypackages/composer.json file should be:
108
+
109
+
When I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
0 commit comments