@@ -68,16 +68,21 @@ Feature: Manage WP-CLI packages
6868 And I run `wp package path`
6969 Then save STDOUT as {PACKAGE_PATH}
7070
71- When I run `cp {PACKAGE_PATH}/composer.json before.json`
72- And I try `wp package install runcommand/hook:999999.0.0`
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`
7375 Then the return code should not be 0
7476 And STDERR should contain:
7577 """
7678 Reverted composer.json.
7779 """
7880
79- When I run `cmp before.json {PACKAGE_PATH}/composer.json`
80- Then the return code should be 0
81+ When I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
82+ Then STDOUT should be:
83+ """
84+ {COMPOSER_JSON_MD5}
85+ """
8186
8287 Given a kept/composer.json file:
8388 """
@@ -91,16 +96,21 @@ Feature: Manage WP-CLI packages
9196 """
9297
9398 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`
94- And I run `cp {PACKAGE_PATH}/composer.json before.json`
95- And I try `wp package uninstall runcommand/hook`
99+ And I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
100+ Then save STDOUT as {COMPOSER_JSON_MD5}
101+
102+ When I try `wp package uninstall runcommand/hook`
96103 Then the return code should not be 0
97104 And STDERR should contain:
98105 """
99106 Reverted composer.json.
100107 """
101108
102- When I run `cmp before.json {PACKAGE_PATH}/composer.json`
103- Then the return code should be 0
109+ When I run `wp eval "echo md5_file( '{PACKAGE_PATH}/composer.json' );" --skip-wordpress`
110+ Then STDOUT should be:
111+ """
112+ {COMPOSER_JSON_MD5}
113+ """
104114
105115 @github-api
106116 Scenario : Try to run with a bad WP_CLI_PACKAGES_DIR/composer.json
@@ -332,9 +342,10 @@ Feature: Manage WP-CLI packages
332342 {SUITE_CACHE_DIR}/composer/composer-
333343 """
334344
335- When I run `ls {SUITE_CACHE_DIR}/composer/composer-*.phar`
345+ When I run `wp eval "echo current( glob( ' {SUITE_CACHE_DIR}/composer/composer-*.phar' ) );" --skip-wordpress `
336346 Then save STDOUT as {COMPOSER_PHAR}
337347 And the {COMPOSER_PHAR} file should exist
348+ And the {SUITE_CACHE_DIR}/composer/versions.json file should exist
338349
339350 When I run `wp package update`
340351 Then STDERR should be empty
@@ -355,7 +366,7 @@ Feature: Manage WP-CLI packages
355366 """
356367
357368 When I run `wp package install ./local-package`
358- And I run `ls {SUITE_CACHE_DIR}/composer/composer-*.phar`
369+ And I run `wp eval "echo current( glob( ' {SUITE_CACHE_DIR}/composer/composer-*.phar' ) );" --skip-wordpress `
359370 Then save STDOUT as {COMPOSER_PHAR}
360371
361372 When I run `wp package uninstall local/binary-test`
0 commit comments