Merge pull request #27017 from woocommerce/fix/25480

Fixed the `shipping_zone_method` CLI command's instance_id parameter
This commit is contained in:
Christopher Allford 2020-07-20 11:00:08 -07:00 committed by GitHub
commit 840554d788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -113,7 +113,8 @@ class WC_CLI_Runner {
'refund_id' => __( 'Refund ID.', 'woocommerce' ),
'attribute_id' => __( 'Attribute ID.', 'woocommerce' ),
'zone_id' => __( 'Zone ID.', 'woocommerce' ),
'id' => __( 'ID.', 'woocommerce' ),
'instance_id' => __( 'Instance ID.', 'woocommerce' ),
'id' => __( 'The ID for the resource.', 'woocommerce' ),
);
$rest_command->set_supported_ids( $supported_ids );
$positional_args = array_keys( $supported_ids );
@ -166,14 +167,6 @@ class WC_CLI_Runner {
$ids[] = $id_name;
}
}
if ( in_array( $command, array( 'delete', 'get', 'update' ), true ) && ! in_array( 'id', $ids, true ) ) {
$synopsis[] = array(
'name' => 'id',
'type' => 'positional',
'description' => __( 'The id for the resource.', 'woocommerce' ),
'optional' => false,
);
}
foreach ( $endpoint_args as $name => $args ) {
if ( ! in_array( $name, $positional_args, true ) || strpos( $route, '<' . $id_name . '>' ) === false ) {

1
tests/cli/bin/install-package-tests.sh Normal file → Executable file
View File

@ -3,6 +3,7 @@
set -ex
PACKAGE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
WP_CLI_BIN_DIR="${PACKAGE_DIR}/bin"
download() {
if [ `which curl` ]; then