diff --git a/assets/css/activation.scss b/assets/css/activation.scss index e21c839aa7c..1823bd69dce 100644 --- a/assets/css/activation.scss +++ b/assets/css/activation.scss @@ -66,34 +66,3 @@ p.woocommerce-actions, .woocommerce-about-text { margin-bottom: 1em !important; } - -div.woocommerce-legacy-shipping-notice, -div.woocommerce-no-shipping-methods-notice { - overflow: hidden; - padding: 1px 12px; - - p { - position: relative; - z-index: 1; - line-height: 1.5em; - margin: 12px 0; - - &.main { - font-size: 1.1em; - } - } - - &::before { - content: "\e01b"; - font-family: "WooCommerce"; - text-align: center; - line-height: 1; - color: #f7f1f6; - display: block; - width: 1em; - font-size: 20em; - top: 36px; - right: 12px; - position: absolute; - } -} diff --git a/assets/css/wc-setup.scss b/assets/css/wc-setup.scss index 92f50c4c998..f562f3e3b71 100644 --- a/assets/css/wc-setup.scss +++ b/assets/css/wc-setup.scss @@ -18,7 +18,7 @@ body { .select2-container { text-align: left; - width: 100%; + width: auto; } .hidden { display: none; diff --git a/assets/js/admin/reports.js b/assets/js/admin/reports.js index 6e38ae4cd64..3173462e470 100644 --- a/assets/js/admin/reports.js +++ b/assets/js/admin/reports.js @@ -138,7 +138,7 @@ jQuery(function( $ ) { var groupby = $( this ) .data( 'groupby' ); var index_type = $( this ).data( 'index_type' ); var export_format = $( this ).data( 'export' ); - var csv_data = 'data:text/csv;charset=utf-8,\uFEFF'; + var csv_data = ''; var s, series_data, d; if ( 'table' === export_format ) { @@ -243,8 +243,9 @@ jQuery(function( $ ) { } ); } + csv_data = 'data:text/csv;charset=utf-8,\uFEFF' + encodeURIComponent( csv_data ); // Set data as href and return - $( this ).attr( 'href', encodeURI( csv_data ) ); + $( this ).attr( 'href', csv_data ); return true; }); }); diff --git a/assets/js/admin/settings.js b/assets/js/admin/settings.js index 87212f1de43..ad008ff08fc 100644 --- a/assets/js/admin/settings.js +++ b/assets/js/admin/settings.js @@ -161,12 +161,28 @@ lastRow = $( this ).find( 'tbody tr:last' ), firstRow = $( this ).find( 'tbody tr:first' ); - table.find( '.wc-item-reorder-nav .wc-move-disabled' ).removeClass( 'wc-move-disabled' ).attr( { 'tabindex': '0', 'aria-hidden': 'false' } ); - firstRow.find( '.wc-item-reorder-nav .wc-move-up' ).addClass( 'wc-move-disabled' ).attr( { 'tabindex': '-1', 'aria-hidden': 'true' } ); - lastRow.find( '.wc-item-reorder-nav .wc-move-down' ).addClass( 'wc-move-disabled' ).attr( { 'tabindex': '-1', 'aria-hidden': 'true' } ); + table.find( '.wc-item-reorder-nav .wc-move-disabled' ).removeClass( 'wc-move-disabled' ) + .attr( { 'tabindex': '0', 'aria-hidden': 'false' } ); + firstRow.find( '.wc-item-reorder-nav .wc-move-up' ).addClass( 'wc-move-disabled' ) + .attr( { 'tabindex': '-1', 'aria-hidden': 'true' } ); + lastRow.find( '.wc-item-reorder-nav .wc-move-down' ).addClass( 'wc-move-disabled' ) + .attr( { 'tabindex': '-1', 'aria-hidden': 'true' } ); } ); $( '.wc-item-reorder-nav').closest( 'table' ).trigger( 'updateMoveButtons' ); + + $( '.submit button' ).on( 'click', function() { + if ( + $( 'select#woocommerce_allowed_countries' ).val() === 'specific' && + ! $( '[name="woocommerce_specific_allowed_countries[]"]' ).val() + ) { + if ( window.confirm( woocommerce_settings_params.i18n_no_specific_countries_selected ) ) { + return true; + } + return false; + } + } ); + }); })( jQuery, woocommerce_settings_params, wp ); diff --git a/i18n/locale-info.php b/i18n/locale-info.php index d0e110c4a19..6ca7b1a90d5 100644 --- a/i18n/locale-info.php +++ b/i18n/locale-info.php @@ -543,6 +543,16 @@ return array( ), ), ), + 'RS' => array( + 'currency_code' => 'RSD', + 'currency_pos' => 'right_space', + 'thousand_sep' => '.', + 'decimal_sep' => ',', + 'num_decimals' => 2, + 'weight_unit' => 'kg', + 'dimension_unit' => 'cm', + 'tax_rates' => array(), + ), 'TH' => array( 'currency_code' => 'THB', 'currency_pos' => 'left', diff --git a/i18n/states.php b/i18n/states.php index 34f477fdd3e..e16b990fcfe 100644 --- a/i18n/states.php +++ b/i18n/states.php @@ -1077,6 +1077,7 @@ return array( 'VS' => __( 'Vaslui', 'woocommerce' ), 'VN' => __( 'Vrancea', 'woocommerce' ), ), + 'RS' => array(), 'SG' => array(), 'SK' => array(), 'SI' => array(), diff --git a/includes/admin/class-wc-admin-help.php b/includes/admin/class-wc-admin-help.php index c956b6e49bc..f65153d9b97 100644 --- a/includes/admin/class-wc-admin-help.php +++ b/includes/admin/class-wc-admin-help.php @@ -66,7 +66,7 @@ class WC_Admin_Help { '

' . __( 'Found a bug?', 'woocommerce' ) . '

' . /* translators: 1: GitHub issues URL 2: GitHub contribution guide URL 3: System status report URL */ '

' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your system status report.', 'woocommerce' ), 'https://github.com/woocommerce/woocommerce/issues?state=open', 'https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '

' . - '

' . __( 'Report a bug', 'woocommerce' ) . ' ' . __( 'System status', 'woocommerce' ) . '

', + '

' . __( 'Report a bug', 'woocommerce' ) . ' ' . __( 'System status', 'woocommerce' ) . '

', ) ); diff --git a/includes/admin/class-wc-admin-settings.php b/includes/admin/class-wc-admin-settings.php index a14070723a1..ce024c298f0 100644 --- a/includes/admin/class-wc-admin-settings.php +++ b/includes/admin/class-wc-admin-settings.php @@ -135,10 +135,13 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) : wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'selectWoo' ), WC()->version, true ); wp_localize_script( - 'woocommerce_settings', 'woocommerce_settings_params', array( - 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ), - 'i18n_moved_up' => __( 'Item moved up', 'woocommerce' ), - 'i18n_moved_down' => __( 'Item moved down', 'woocommerce' ), + 'woocommerce_settings', + 'woocommerce_settings_params', + array( + 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ), + 'i18n_moved_up' => __( 'Item moved up', 'woocommerce' ), + 'i18n_moved_down' => __( 'Item moved down', 'woocommerce' ), + 'i18n_no_specific_countries_selected' => __( 'Selecting no country to sell to prevents from completing the checkout. Continue anyway?', 'woocommerce' ), ) ); @@ -391,7 +394,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) : selected( $option_value, (string) $key ); } - ?> + ?> > + ?> diff --git a/includes/admin/class-wc-admin.php b/includes/admin/class-wc-admin.php index 95b1d4db7dc..39157518cbd 100644 --- a/includes/admin/class-wc-admin.php +++ b/includes/admin/class-wc-admin.php @@ -30,6 +30,9 @@ class WC_Admin { add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); add_action( 'wp_ajax_setup_wizard_check_jetpack', array( $this, 'setup_wizard_check_jetpack' ) ); add_action( 'init', array( 'WC_Site_Tracking', 'init' ) ); + + // Disable WXR export of schedule action posts. + add_filter( 'action_scheduler_post_type_args', array( $this, 'disable_webhook_post_export' ) ); } /** @@ -69,8 +72,8 @@ class WC_Admin { } // Setup/welcome. - if ( ! empty( $_GET['page'] ) ) { - switch ( $_GET['page'] ) { + if ( ! empty( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification + switch ( $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification case 'wc-setup': include_once dirname( __FILE__ ) . '/class-wc-admin-setup-wizard.php'; break; @@ -251,7 +254,7 @@ class WC_Admin { $wc_pages = array_diff( $wc_pages, array( 'profile', 'user-edit' ) ); // Check to make sure we're on a WooCommerce admin page. - if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, $wc_pages ) ) ) { + if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, $wc_pages, true ) ) ) { // Change the footer text. if ( ! get_option( 'woocommerce_admin_footer_text_rated' ) ) { $footer_text = sprintf( @@ -288,6 +291,20 @@ class WC_Admin { ) ); } + + /** + * Disable WXR export of scheduled action posts. + * + * @since 3.6.2 + * + * @param array $args Scehduled action post type registration args. + * + * @return array + */ + public function disable_webhook_post_export( $args ) { + $args['can_export'] = false; + return $args; + } } return new WC_Admin(); diff --git a/includes/admin/views/html-notice-legacy-shipping.php b/includes/admin/views/html-notice-legacy-shipping.php index 19bf819b67e..dbed19c15d2 100644 --- a/includes/admin/views/html-notice-legacy-shipping.php +++ b/includes/admin/views/html-notice-legacy-shipping.php @@ -1,22 +1,34 @@ -
- +
+ + + -

-

They will be removed in future versions of WooCommerce. We recommend disabling these and setting up new rates within shipping zones as soon as possible.', 'woocommerce' ); ?>

+

+ +

+

+ They will be removed in future versions of WooCommerce. We recommend disabling these and setting up new rates within shipping zones as soon as possible.', 'woocommerce' ); ?> +

- + + + - + + +

diff --git a/includes/admin/views/html-notice-no-shipping-methods.php b/includes/admin/views/html-notice-no-shipping-methods.php index 2c0e95ba7f5..da2d022cefd 100644 --- a/includes/admin/views/html-notice-no-shipping-methods.php +++ b/includes/admin/views/html-notice-no-shipping-methods.php @@ -1,21 +1,37 @@ -
- +
+ + + -

-

-

+

+ + + +

+

+ +

+

+ +

- - + + + + + +

diff --git a/includes/api/v2/class-wc-rest-system-status-v2-controller.php b/includes/api/v2/class-wc-rest-system-status-v2-controller.php index 70152fa3c0f..f12588dd089 100644 --- a/includes/api/v2/class-wc-rest-system-status-v2-controller.php +++ b/includes/api/v2/class-wc-rest-system-status-v2-controller.php @@ -878,8 +878,8 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { $version_latest = $data['Version']; // Find latest version. - if ( isset( $available_updates[ $plugin ]->update->new_version ) ) { - $version_latest = $available_updates[ $plugin ]->update->new_version; + if ( isset( $this->available_updates[ $plugin ]->update->new_version ) ) { + $version_latest = $this->available_updates[ $plugin ]->update->new_version; } return array( diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 3636a75ee4a..8a46b6013b4 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -1176,7 +1176,7 @@ class WC_Checkout { if ( is_user_logged_in() ) { // Load customer object, but keep it cached to avoid reloading it multiple times. if ( is_null( $this->logged_in_customer ) ) { - $this->logged_in_customer = new WC_Customer( get_current_user_id() ); + $this->logged_in_customer = new WC_Customer( get_current_user_id(), true ); } $customer_object = $this->logged_in_customer; } diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index 24f11f665ee..60b3117c637 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -501,6 +501,7 @@ class WC_Countries { 'PL' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'PT' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'SK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", + 'RS' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'SI' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'ES' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{state}\n{country}", 'SE' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", @@ -1103,6 +1104,12 @@ class WC_Countries { 'required' => true, ), ), + 'RS' => array( + 'state' => array( + 'required' => false, + 'hidden' => true, + ), + ), 'SG' => array( 'state' => array( 'required' => false, diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 9eb8d3b5550..8c9a6c03ed4 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -961,7 +961,7 @@ class WC_Form_Handler { try { $creds = array( 'user_login' => trim( wp_unslash( $_POST['username'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - 'user_password' => wp_unslash( $_POST['password'] ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + 'user_password' => $_POST['password'], // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash 'remember' => isset( $_POST['rememberme'] ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ); diff --git a/includes/class-wc-webhook.php b/includes/class-wc-webhook.php index 12101c50032..eba32270a1a 100644 --- a/includes/class-wc-webhook.php +++ b/includes/class-wc-webhook.php @@ -38,7 +38,7 @@ class WC_Webhook extends WC_Legacy_Webhook { 'event' => '', 'failure_count' => 0, 'user_id' => 0, - 'api_version' => 2, + 'api_version' => 3, 'pending_delivery' => false, ); diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index a03942ca5fd..164e980bb19 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -20,7 +20,7 @@ final class WooCommerce { * * @var string */ - public $version = '3.6.0'; + public $version = '3.7.0'; /** * The single instance of the class. @@ -152,6 +152,7 @@ final class WooCommerce { */ public function __construct() { $this->define_constants(); + $this->define_tables(); $this->includes(); $this->init_hooks(); } @@ -184,7 +185,6 @@ final class WooCommerce { add_action( 'init', array( $this, 'init' ), 0 ); add_action( 'init', array( 'WC_Shortcodes', 'init' ) ); add_action( 'init', array( 'WC_Emails', 'init_transactional_emails' ) ); - add_action( 'init', array( $this, 'wpdb_table_fix' ), 0 ); add_action( 'init', array( $this, 'add_image_sizes' ) ); add_action( 'switch_blog', array( $this, 'wpdb_table_fix' ), 0 ); add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); @@ -230,6 +230,25 @@ final class WooCommerce { $this->define( 'WC_TEMPLATE_DEBUG_MODE', false ); } + /** + * Register custom tables within $wpdb object. + */ + private function define_tables() { + global $wpdb; + + // List of tables without prefixes. + $tables = array( + 'payment_tokenmeta' => 'woocommerce_payment_tokenmeta', + 'order_itemmeta' => 'woocommerce_order_itemmeta', + 'wc_product_meta_lookup' => 'wc_product_meta_lookup', + ); + + foreach ( $tables as $name => $table ) { + $wpdb->$name = $wpdb->prefix . $table; + $wpdb->tables[] = $table; + } + } + /** * Define constant if not already set. * @@ -710,16 +729,7 @@ final class WooCommerce { * Set tablenames inside WPDB object. */ public function wpdb_table_fix() { - global $wpdb; - - $wpdb->payment_tokenmeta = $wpdb->prefix . 'woocommerce_payment_tokenmeta'; - $wpdb->tables[] = 'woocommerce_payment_tokenmeta'; - - $wpdb->order_itemmeta = $wpdb->prefix . 'woocommerce_order_itemmeta'; - $wpdb->tables[] = 'woocommerce_order_itemmeta'; - - $wpdb->wc_product_meta_lookup = $wpdb->prefix . 'wc_product_meta_lookup'; - $wpdb->tables[] = 'wc_product_meta_lookup'; + $this->define_tables(); } /** diff --git a/includes/tracks/events/class-wc-admin-setup-wizard-tracking.php b/includes/tracks/events/class-wc-admin-setup-wizard-tracking.php index 6ea40c48fa6..11b5950e3ea 100644 --- a/includes/tracks/events/class-wc-admin-setup-wizard-tracking.php +++ b/includes/tracks/events/class-wc-admin-setup-wizard-tracking.php @@ -50,6 +50,7 @@ class WC_Admin_Setup_Wizard_Tracking { public function add_footer_scripts() { wp_print_scripts(); WC_Site_Tracking::add_tracking_function(); + wc_print_js(); } /** diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 1425babb547..d22f7ddb8a7 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -705,7 +705,7 @@ function wc_query_string_form_fields( $values = null, $exclude = array(), $curre $values = array(); if ( ! empty( $url_parts['query'] ) ) { - // This is to preserve full-stops and spaces in the query string when ran through parse_str. + // This is to preserve full-stops, pluses and spaces in the query string when ran through parse_str. $replace_chars = array( '.' => '{dot}', '+' => '{plus}', @@ -717,9 +717,11 @@ function wc_query_string_form_fields( $values = null, $exclude = array(), $curre // Parse the string. parse_str( $query_string, $parsed_query_string ); - // Convert the full-stops back and add to values array. + // Convert the full-stops, pluses and spaces back and add to values array. foreach ( $parsed_query_string as $key => $value ) { - $values[ str_replace( array_values( $replace_chars ), array_keys( $replace_chars ), $key ) ] = $value; + $new_key = str_replace( array_values( $replace_chars ), array_keys( $replace_chars ), $key ); + $new_value = str_replace( array_values( $replace_chars ), array_keys( $replace_chars ), $value ); + $values[ $new_key ] = $new_value; } } } diff --git a/includes/wc-term-functions.php b/includes/wc-term-functions.php index cf03a635d09..e16f9e2088e 100644 --- a/includes/wc-term-functions.php +++ b/includes/wc-term-functions.php @@ -23,7 +23,7 @@ function wc_change_get_terms_defaults( $defaults, $taxonomies ) { if ( is_array( $taxonomies ) && 1 < count( $taxonomies ) ) { return $defaults; } - $taxonomy = is_array( $taxonomies ) ? $taxonomies[0] : $taxonomies; + $taxonomy = is_array( $taxonomies ) ? (string) current( $taxonomies ) : $taxonomies; $orderby = 'name'; if ( taxonomy_is_product_attribute( $taxonomy ) ) { diff --git a/package-lock.json b/package-lock.json index ad2e71500c6..11a08d8a577 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,18 +14,18 @@ } }, "@babel/core": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.3.tgz", - "integrity": "sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz", + "integrity": "sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", - "@babel/helpers": "^7.4.3", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", + "@babel/generator": "^7.4.4", + "@babel/helpers": "^7.4.4", + "@babel/parser": "^7.4.4", + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -35,73 +35,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "@babel/generator": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.0.tgz", - "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", - "dev": true, - "requires": { - "@babel/types": "^7.4.0", - "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz", - "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", - "dev": true, - "requires": { - "@babel/types": "^7.4.0" - } - }, - "@babel/parser": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.3.tgz", - "integrity": "sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ==", - "dev": true - }, - "@babel/template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz", - "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.0", - "@babel/types": "^7.4.0" - } - }, - "@babel/traverse": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.3.tgz", - "integrity": "sha512-HmA01qrtaCwwJWpSKpA948cBvU5BrmviAief/b3AVw936DtcdsTexlbyzNuDnthwhOQ37xshn7hvQaEQk7ISYQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/types": "^7.4.0", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.11" - } - }, - "@babel/types": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.0.tgz", - "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.11", - "to-fast-properties": "^2.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -111,18 +44,6 @@ "ms": "^2.1.1" } }, - "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, "json5": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", @@ -144,38 +65,23 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true } } }, "@babel/generator": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.2.tgz", - "integrity": "sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", "dev": true, "requires": { - "@babel/types": "^7.2.2", + "@babel/types": "^7.4.4", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -215,131 +121,23 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.4" } }, "@babel/helpers": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.3.tgz", - "integrity": "sha512-BMh7X0oZqb36CfyhvtbSmcWc3GXocfxv3yNsAEuM0l+fAqSO22rQrUpijr3oE/10jCTrB6/0b9kzmG4VetCj8Q==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz", + "integrity": "sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==", "dev": true, "requires": { - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0" - }, - "dependencies": { - "@babel/generator": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.0.tgz", - "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", - "dev": true, - "requires": { - "@babel/types": "^7.4.0", - "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz", - "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", - "dev": true, - "requires": { - "@babel/types": "^7.4.0" - } - }, - "@babel/parser": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.3.tgz", - "integrity": "sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ==", - "dev": true - }, - "@babel/template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz", - "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.0", - "@babel/types": "^7.4.0" - } - }, - "@babel/traverse": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.3.tgz", - "integrity": "sha512-HmA01qrtaCwwJWpSKpA948cBvU5BrmviAief/b3AVw936DtcdsTexlbyzNuDnthwhOQ37xshn7hvQaEQk7ISYQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/types": "^7.4.0", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.11" - } - }, - "@babel/types": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.0.tgz", - "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.11", - "to-fast-properties": "^2.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - } + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4" } }, "@babel/highlight": { @@ -351,34 +149,26 @@ "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" - }, - "dependencies": { - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - } } }, "@babel/parser": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz", - "integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", + "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", "dev": true }, "@babel/runtime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", - "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.4.tgz", + "integrity": "sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg==", "requires": { - "regenerator-runtime": "^0.12.0" + "regenerator-runtime": "^0.13.2" }, "dependencies": { "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, @@ -389,41 +179,34 @@ "requires": { "core-js": "^2.5.7", "regenerator-runtime": "^0.12.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - } } }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" } }, "@babel/traverse": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", - "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", + "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.4.4", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.2.3", - "@babel/types": "^7.2.2", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" }, "dependencies": { "debug": { @@ -436,9 +219,9 @@ } }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "ms": { @@ -450,13 +233,13 @@ } }, "@babel/types": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.2.tgz", - "integrity": "sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" }, "dependencies": { @@ -544,9 +327,9 @@ "dev": true }, "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.0.tgz", + "integrity": "sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg==", "dev": true }, "@types/normalize-package-data": { @@ -628,13 +411,6 @@ "react-dates": "^18.0.4", "react-router-dom": "4.3.1", "react-transition-group": "^2.4.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", - "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==" - } } }, "@woocommerce/csv-export": { @@ -767,11 +543,6 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==" }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" - }, "regenerator-runtime": { "version": "0.13.2", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", @@ -817,21 +588,6 @@ "requires": { "@babel/runtime": "^7.3.1", "@wordpress/dom-ready": "^2.2.0" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/api-fetch": { @@ -856,36 +612,7 @@ "memize": "^1.0.5", "sprintf-js": "^1.1.1", "tannin": "^1.0.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - } } - }, - "gettext-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz", - "integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==", - "requires": { - "encoding": "^0.1.12", - "safe-buffer": "^5.1.1" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - }, - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" } } }, @@ -973,14 +700,6 @@ "turbo-combine-reducers": "^1.0.2" }, "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, "@wordpress/compose": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.2.0.tgz", @@ -1003,11 +722,6 @@ "react": "^16.8.4", "react-dom": "^16.8.4" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, @@ -1028,21 +742,6 @@ "requires": { "@babel/runtime": "^7.3.1", "lodash": "^4.17.11" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/dom-ready": { @@ -1051,21 +750,6 @@ "integrity": "sha512-tPmPcc7T+BGXS7WyIJ+hWzMR5YXBjQIWNWcFMcqMxjgm5MbTWnjvrv4o4FJ7evuWJlTa+4Rw2Tjc0iHAqr4aVA==", "requires": { "@babel/runtime": "^7.3.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/element": { @@ -1086,21 +770,6 @@ "integrity": "sha512-IILebUBTFADag62cwxYcLFYoKeHRpDZiKwwhabiWd2sGoSdci1cqLxmLbE8iMcMQru7ALptQgQmhZcuX87DEwg==", "requires": { "@babel/runtime": "^7.3.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/hooks": { @@ -1109,21 +778,6 @@ "integrity": "sha512-pzLDgcQOPCU4xSN0yuGoPd9xeNW2MnB2o7O52qaFZ2DSmf9tN+OkPDg7lKsg7SEds0J7GngBS8tu+a4Lqywy/w==", "requires": { "@babel/runtime": "^7.3.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/html-entities": { @@ -1145,22 +799,6 @@ "memize": "^1.0.5", "sprintf-js": "^1.1.1", "tannin": "^1.0.1" - }, - "dependencies": { - "gettext-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz", - "integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==", - "requires": { - "encoding": "^0.1.12", - "safe-buffer": "^5.1.1" - } - }, - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" - } } }, "@wordpress/is-shallow-equal": { @@ -1169,21 +807,6 @@ "integrity": "sha512-WLB1sEz0xjtzJnorJTSuEpaYjo0E9zir0lJGwRjhYHlTjzngTakFPlifcvPVm7saA9KR9/t82jxOENAIWFzftQ==", "requires": { "@babel/runtime": "^7.3.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/keycodes": { @@ -1202,21 +825,6 @@ "integrity": "sha512-WFdGqyb4PDvtQzrTFoONGTzGiwKvOaJ4bm2j5VSpR7Oz1vJWmZP7/5TXApDXNr+RKCo/ahmkRmtUilu4M9WKVg==", "requires": { "@babel/runtime": "^7.3.1" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/redux-routine": { @@ -1227,21 +835,6 @@ "@babel/runtime": "^7.3.1", "is-promise": "^2.1.0", "rungen": "^0.3.2" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/rich-text": { @@ -1257,14 +850,6 @@ "rememo": "^3.0.0" }, "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, "@wordpress/compose": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.2.0.tgz", @@ -1287,11 +872,6 @@ "react": "^16.8.4", "react-dom": "^16.8.4" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, @@ -1302,21 +882,6 @@ "requires": { "@babel/runtime": "^7.3.1", "qs": "^6.5.2" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "@wordpress/viewport": { @@ -1331,14 +896,6 @@ "lodash": "^4.17.11" }, "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, "@wordpress/compose": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@wordpress/compose/-/compose-3.2.0.tgz", @@ -1361,11 +918,6 @@ "react": "^16.8.4", "react-dom": "^16.8.4" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, @@ -1456,10 +1008,9 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", + "integrity": "sha1-QchHGUZGN15qGl0Qw8oFTvn8mA0=" }, "ansi-styles": { "version": "3.2.1", @@ -1649,9 +1200,9 @@ "dev": true }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true, "optional": true }, @@ -1685,19 +1236,6 @@ "num2fraction": "^1.2.2", "postcss": "^7.0.14", "postcss-value-parser": "^3.3.1" - }, - "dependencies": { - "postcss": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.14.tgz", - "integrity": "sha512-NsbD6XUUMZvBxtQAJuWDJeeC4QFsmWsfozWxCJPWf3M55K9iu2iMDaKqyoOdTJ1R4usBXuxlVFAIo8rZPQD4Bg==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - } - } } }, "aws-sign2": { @@ -1760,6 +1298,12 @@ "js-tokens": "^3.0.2" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -1779,6 +1323,21 @@ "supports-color": "^2.0.0" } }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -2292,535 +1851,6 @@ } } }, - "fsevents": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz", - "integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -3437,6 +2467,14 @@ "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } } }, "babel-template": { @@ -3488,9 +2526,9 @@ "dev": true }, "bail": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.3.tgz", - "integrity": "sha512-1X8CnjFVQ+a+KW36uBNMTU5s8+v5FzeqrP7hTG5aTb4aPreSbZJlhwPon9VKMuEVgV++JM+SQrALY3kr7eswdg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.4.tgz", + "integrity": "sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww==", "dev": true }, "balanced-match": { @@ -3576,9 +2614,9 @@ } }, "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true, "optional": true }, @@ -3592,9 +2630,9 @@ } }, "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", + "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==", "dev": true }, "body": { @@ -3648,14 +2686,14 @@ "dev": true }, "browserslist": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.4.tgz", - "integrity": "sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag==", + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.6.tgz", + "integrity": "sha512-o/hPOtbU9oX507lIqon+UvPYqpx3mHc8cV3QemSBTXwkG8gSQSK6UKvXcE/DcleU3+A59XTUHyCvZ5qGy8xVAg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000955", - "electron-to-chromium": "^1.3.122", - "node-releases": "^1.1.13" + "caniuse-lite": "^1.0.30000963", + "electron-to-chromium": "^1.3.127", + "node-releases": "^1.1.17" } }, "buffer-from": { @@ -3664,12 +2702,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", @@ -3734,9 +2766,9 @@ } }, "callsites": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", - "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { @@ -3756,9 +2788,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000957", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz", - "integrity": "sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==", + "version": "1.0.30000967", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz", + "integrity": "sha512-rUBIbap+VJfxTzrM4akJ00lkvVb5/n5v3EGXfWzSH5zT8aJmGzjA8HWhJ4U6kCpzxozUSnB+yvAYDRPY6mRpgQ==", "dev": true }, "caseless": { @@ -3825,9 +2857,9 @@ "dev": true }, "character-entities-html4": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.2.tgz", - "integrity": "sha512-sIrXwyna2+5b0eB9W149izTPJk/KkJTg6mEzDGibwBUkyH1SbDa+nf515Ppdi3MaH35lW0JFJDWeq9Luzes1Iw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.3.tgz", + "integrity": "sha512-SwnyZ7jQBCRHELk9zf2CN5AnGEc2nA+uKMZLHvcqhpPprjkYhiLn0DywMHgN5ttFZuITMATbh68M6VIVKwJbcg==", "dev": true }, "character-entities-legacy": { @@ -3872,13 +2904,6 @@ "readdirp": "^2.0.0" } }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true, - "optional": true - }, "chromedriver": { "version": "74.0.0", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-74.0.0.tgz", @@ -3976,11 +3001,46 @@ "string-width": "^1.0.1" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "slice-ansi": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } } } }, @@ -4001,16 +3061,40 @@ } }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -4019,6 +3103,34 @@ "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } } } } @@ -4051,9 +3163,9 @@ "dev": true }, "collapse-white-space": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz", - "integrity": "sha512-YfQ1tAUZm561vpYD+5eyWN8+UsceQbSrqqlc/6zDY2gtAE+uZLSdkkovhnGpmCThsvKBFakq4EdY/FF93E8XIw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.5.tgz", + "integrity": "sha512-703bOOmytCYAX9cXYqoikYIx6twmFCXsnzRQheBcTG3nzKYBR4P/+wkYeH+Mvj7qUz8zZDtdyzbxfnEi/kYzRQ==", "dev": true }, "collection-visit": { @@ -4094,21 +3206,6 @@ "requires": { "strip-ansi": "^2.0.1", "wcwidth": "^1.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", - "integrity": "sha1-QchHGUZGN15qGl0Qw8oFTvn8mA0=" - }, - "strip-ansi": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", - "integrity": "sha1-32LBqpTtLxFOHQ8h/R1QSCt5pg4=", - "requires": { - "ansi-regex": "^1.0.0" - } - } } }, "combined-stream": { @@ -4121,15 +3218,15 @@ } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -4161,7 +3258,7 @@ "dependencies": { "json5": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { @@ -4170,7 +3267,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -4218,9 +3315,9 @@ "dev": true }, "core-js": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.2.tgz", - "integrity": "sha512-NdBPF/RVwPW6jr0NCILuyN9RiqLo2b1mddWHkUL+VnvcB7dzlnBJ1bXYntjpTGOgkZiiLWj2JxmOr7eGE3qK6g==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", + "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==" }, "core-util-is": { "version": "1.0.2", @@ -4229,14 +3326,14 @@ "dev": true }, "cosmiconfig": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.7.tgz", - "integrity": "sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz", + "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", "dev": true, "requires": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", - "js-yaml": "^3.9.0", + "js-yaml": "^3.13.0", "parse-json": "^4.0.0" }, "dependencies": { @@ -4475,13 +3572,6 @@ "type-detect": "^4.0.0" } }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "optional": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -4617,13 +3707,6 @@ "repeating": "^2.0.0" } }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true, - "optional": true - }, "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -4683,21 +3766,6 @@ "integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==", "requires": { "@babel/runtime": "^7.1.2" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "dom-scroll-into-view": { @@ -4706,21 +3774,15 @@ "integrity": "sha1-6PNnMt0ImwIBqI14Fdw/iObWbH4=" }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "^1.3.0", + "entities": "^1.1.1" }, "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -4790,6 +3852,17 @@ "lru-cache": "^3.2.0", "semver": "^5.1.0", "sigmund": "^1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "dev": true, + "requires": { + "pseudomap": "^1.0.1" + } + } } }, "editorconfig-to-prettier": { @@ -4799,9 +3872,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.124", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz", - "integrity": "sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w==", + "version": "1.3.131", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.131.tgz", + "integrity": "sha512-NSO4jLeyGLWrT4mzzfYX8vt1MYCoMI5LxSYAjt0H9+LF/14JyiKJSyyjA6AJTxflZlEM5v3QU33F0ohbPMCAPg==", "dev": true }, "elegant-spinner": { @@ -4820,9 +3893,9 @@ } }, "emoji-regex": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "encoding": { @@ -4896,9 +3969,9 @@ } }, "es6-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", - "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", "dev": true }, "es6-promisify": { @@ -4908,14 +3981,6 @@ "dev": true, "requires": { "es6-promise": "^4.0.3" - }, - "dependencies": { - "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", - "dev": true - } } }, "escape-string-regexp": { @@ -4968,18 +4033,6 @@ "text-table": "^0.2.0" }, "dependencies": { - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -4995,12 +4048,6 @@ "ms": "^2.1.1" } }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -5012,72 +4059,17 @@ } }, "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -5086,18 +4078,6 @@ "requires": { "ansi-regex": "^3.0.0" } - }, - "table": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", - "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", - "dev": true, - "requires": { - "ajv": "^6.9.1", - "lodash": "^4.17.11", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - } } } }, @@ -5935,16 +4915,6 @@ "universalify": "^0.1.0" } }, - "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -5958,14 +4928,551 @@ "dev": true }, "fsevents": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.6.tgz", - "integrity": "sha512-BalK54tfK0pMC0jQFb2oHn1nz7JNQD/2ex5pBnCHgBi2xG7VV0cAOGy2RS2VbCqUXx5/6obMrMcQTJ8yjcGzbg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true + } } }, "fstream": { @@ -6026,6 +5533,43 @@ "string-width": "^1.0.1", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } } }, "gaze": { @@ -6038,9 +5582,9 @@ } }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-func-name": { @@ -6092,39 +5636,32 @@ } }, "gettext-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-3.1.0.tgz", - "integrity": "sha512-eVD8RxFMeHg8pjl5zsk7xlEDaKdcYlotLztiMaYGLvI13LMXwWlybLg7rg6eagct79vyGkPGZrMPBsdjsQOnWg==", - "dev": true, + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz", + "integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==", "requires": { "encoding": "^0.1.12", - "readable-stream": "^3.0.6", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } + "safe-buffer": "^5.1.1" } }, "github-contributors-list": { "version": "https://github.com/woocommerce/github-contributors-list/tarball/master", - "integrity": "sha512-B2yGehx2B1Fg0ooPCxcbq2fRE+YvAh1Yssa6Kp/sGMCRgDD9+yR6Fa5urn+cOqMbOvuAVZElVqQx+4wVm4JWgw==", + "integrity": "sha512-4lJ4ERWmcGlG43jDdIy7shG0v3QsfoSvSrtbdcw/cpqF69WBOoHu1iC8Cb3IQ63WU7KujtR0TEF50CEcebhRCA==", "dev": true, "requires": { - "marked": "~0.3.1", - "merge": "^1.2.0", - "minimist": "0.0.8", - "q": "~1.4.1", - "sprintf-js": "0.0.7" + "marked": "~0.6.2", + "merge": "^1.2.1", + "minimist": "1.2.0", + "q": "~1.5.1", + "sprintf-js": "1.1.2" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "glob": { @@ -6353,24 +5890,11 @@ "resolve": "~1.1.0" } }, - "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true } } }, @@ -6413,12 +5937,12 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } } } @@ -6433,6 +5957,12 @@ "source-map": "^0.5.3" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6458,6 +5988,15 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6476,6 +6015,12 @@ "file-sync-cmp": "^0.1.0" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6495,6 +6040,15 @@ "supports-color": "^2.0.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6535,18 +6089,6 @@ "maxmin": "^2.1.0", "uglify-js": "^3.5.0", "uri-path": "^1.0.0" - }, - "dependencies": { - "uglify-js": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.1.tgz", - "integrity": "sha512-kI+3c+KphOAKIikQsZoT2oDsVYH5qvhpTtFObfMCdhPAYnjSvmW4oTWMhvDD4jtAGHJwztlBXQgozGcq3Xw9oQ==", - "dev": true, - "requires": { - "commander": "~2.19.0", - "source-map": "~0.6.1" - } - } } }, "grunt-contrib-watch": { @@ -6562,12 +6104,12 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } } } @@ -6670,6 +6212,12 @@ "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6735,6 +6283,15 @@ "through": "^2.3.6" } }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "lodash": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", @@ -6766,6 +6323,26 @@ "once": "^1.3.0" } }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6784,6 +6361,12 @@ "rtlcss": "^2.0.0" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -6803,6 +6386,15 @@ "supports-color": "^2.0.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6829,18 +6421,18 @@ }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^4.0.0" + "ansi-regex": "^4.1.0" } } } @@ -6874,26 +6466,15 @@ } }, "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", "dev": true, "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - } } }, "har-schema": { @@ -6927,6 +6508,14 @@ "dev": true, "requires": { "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } } }, "has-color": { @@ -7029,21 +6618,6 @@ "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0", "value-equal": "^0.4.0" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", - "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } } }, "hoist-non-react-statics": { @@ -7092,12 +6666,6 @@ "readable-stream": "1.1" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -7180,18 +6748,6 @@ "slash": "^2.0.0" }, "dependencies": { - "cosmiconfig": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz", - "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.0", - "parse-json": "^4.0.0" - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -7207,38 +6763,6 @@ "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", "dev": true }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - } - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -7261,21 +6785,6 @@ "type-fest": "^0.4.1" } }, - "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -7298,16 +6807,6 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, "immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", @@ -7380,9 +6879,9 @@ "dev": true }, "inquirer": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", - "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", "dev": true, "requires": { "ansi-escapes": "^3.2.0", @@ -7396,43 +6895,16 @@ "run-async": "^2.2.0", "rxjs": "^6.4.0", "string-width": "^2.1.0", - "strip-ansi": "^5.0.0", + "strip-ansi": "^5.1.0", "through": "^2.3.6" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -7440,14 +6912,6 @@ "dev": true, "requires": { "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } } } } @@ -7471,9 +6935,9 @@ } }, "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "ip-regex": { @@ -7535,15 +6999,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -7642,13 +7097,10 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-glob": { "version": "2.0.1", @@ -7842,10 +7294,9 @@ } }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, "isexe": { "version": "2.0.0", @@ -7861,6 +7312,15 @@ "optional": true, "requires": { "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + } } }, "isomorphic-fetch": { @@ -7899,15 +7359,6 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", "dev": true - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } } } }, @@ -7931,12 +7382,12 @@ }, "dependencies": { "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } } } @@ -8079,20 +7530,20 @@ } }, "js-base64": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.0.tgz", - "integrity": "sha512-wlEBIZ5LP8usDylWbDNhKPEFVFdI5hCHpnVoT/Ysvoi/PRhJENm/Rlh9TvjYB38HFfKZN7OzEbRjmjvLkFw11g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", + "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", - "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -8193,50 +7644,15 @@ } }, "jszip": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", - "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.1.tgz", + "integrity": "sha512-iCMBbo4eE5rb1VCpm5qXOAaUiRKRUKiItn8ah2YQQx9qymmSAY98eyQfioChEYcVQLh0zxJ3wS4A0mh90AVPvw==", "dev": true, "requires": { - "core-js": "~2.3.0", - "es6-promise": "~3.0.2", - "lie": "~3.1.0", + "lie": "~3.3.0", "pako": "~1.0.2", - "readable-stream": "~2.0.6" - }, - "dependencies": { - "core-js": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", - "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" } }, "kind-of": { @@ -8255,12 +7671,12 @@ "dev": true }, "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "^2.0.0" } }, "leven": { @@ -8280,18 +7696,18 @@ } }, "lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", "dev": true, "requires": { "immediate": "~3.0.5" } }, "lint-staged": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.5.tgz", - "integrity": "sha512-e5ZavfnSLcBJE1BTzRTqw6ly8OkqVyO3GL2M6teSmTBYQ/2BuueD5GIt2RPsP31u/vjKdexUyDCxSyK75q4BDA==", + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.6.tgz", + "integrity": "sha512-QT13AniHN6swAtTjsrzxOfE4TVCiQ39xESwLmjGVNCMMZ/PK5aopwvbxLrzw+Zf9OxM3cQG6WCx9lceLzETOnQ==", "dev": true, "requires": { "chalk": "^2.3.1", @@ -8318,7 +7734,7 @@ "staged-git-files": "1.1.2", "string-argv": "^0.0.2", "stringify-object": "^3.2.2", - "yup": "^0.26.10" + "yup": "^0.27.0" }, "dependencies": { "arr-diff": { @@ -8573,9 +7989,9 @@ "dev": true }, "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -8660,9 +8076,9 @@ }, "dependencies": { "p-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz", - "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", "dev": true } } @@ -8689,6 +8105,12 @@ "strip-ansi": "^3.0.1" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -8733,6 +8155,15 @@ "chalk": "^1.0.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -8954,12 +8385,13 @@ } }, "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { - "pseudomap": "^1.0.1" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "map-age-cleaner": { @@ -9005,9 +8437,9 @@ "dev": true }, "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.2.tgz", + "integrity": "sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==", "dev": true }, "matcher": { @@ -9044,6 +8476,12 @@ "pretty-bytes": "^3.0.0" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -9073,6 +8511,15 @@ "object-assign": "^4.1.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -9091,12 +8538,22 @@ } }, "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + } } }, "memize": { @@ -9210,26 +8667,6 @@ "is-plain-obj": "^1.1.0" } }, - "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", @@ -9291,41 +8728,6 @@ "yargs-unparser": "1.5.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } - } - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -9335,12 +8737,6 @@ "ms": "^2.1.1" } }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -9350,120 +8746,12 @@ "locate-path": "^3.0.0" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -9472,94 +8760,6 @@ "requires": { "has-flag": "^3.0.0" } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" - } - }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, @@ -9594,11 +8794,10 @@ "dev": true }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", - "dev": true, - "optional": true + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "dev": true }, "nanomatch": { "version": "1.2.13", @@ -9645,17 +8844,11 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "dev": true }, "nice-try": { "version": "1.0.5", @@ -9671,14 +8864,6 @@ "requires": { "object.getownpropertydescriptors": "^2.0.3", "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } } }, "node-fetch": { @@ -9710,57 +8895,18 @@ "which": "1" }, "dependencies": { - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, "semver": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true - }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } } } }, - "node-pre-gyp": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", - "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, "node-releases": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.13.tgz", - "integrity": "sha512-fKZGviSXR6YvVPyc011NHuJDSD8gFQvLPmc2d2V3BS4gr52ycyQ1Xzs7a8B+Ax3Ni/W+5h1h4SqmzeoA8WZRmA==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.18.tgz", + "integrity": "sha512-/mnVgm6u/8OwlIsoyRXtTI0RfQcxZoAZbdwyXap0EeWwcOpDDymyCHM2/aR9XKmHXrvizHoPAOs0pcbiJ6RUaA==", "dev": true, "requires": { "semver": "^5.3.0" @@ -9791,6 +8937,12 @@ "true-case-path": "^1.0.2" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -9820,40 +8972,27 @@ "which": "^1.2.9" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "ansi-regex": "^2.0.0" } }, - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", - "dev": true - }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true } } }, "node-wp-i18n": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/node-wp-i18n/-/node-wp-i18n-1.2.2.tgz", - "integrity": "sha512-uRtKibN+PdwED6YzzcdCk4AG7qPt2Cmplpwq0szUz6alz1U/15N1U56EY6kcolGcVrJacW5s70QRB5k8d5k9gg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/node-wp-i18n/-/node-wp-i18n-1.2.3.tgz", + "integrity": "sha512-YMzMcsjXbGYDB9vHyb289CYXAGmXhcNLbeTlOnWgPNkZd9xrovcbRd7cQyKd9BQHOjS7Nw8WCbJ7nvtR7rc0rg==", "dev": true, "requires": { "bluebird": "^3.4.1", @@ -9865,33 +9004,53 @@ "tmp": "^0.0.33" }, "dependencies": { + "gettext-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-3.1.1.tgz", + "integrity": "sha512-vNhWcqXEtZPs5Ft1ReA34g7ByWotpcOIeJvXVy2jF3/G2U9v6W0wG4Z4hXzcU8R//jArqkgHcVCGgGqa4vxVlQ==", + "dev": true, + "requires": { + "encoding": "^0.1.12", + "readable-stream": "^3.2.0", + "safe-buffer": "^5.1.2" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true + }, + "readable-stream": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, - "optional": true, "requires": { - "abbrev": "1", - "osenv": "^0.1.4" + "abbrev": "1" } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } @@ -9917,24 +9076,6 @@ "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=", "dev": true }, - "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, "npm-path": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.4.tgz", @@ -10027,9 +9168,9 @@ "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=" }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, "object-visit": { "version": "1.0.1", @@ -10176,12 +9317,14 @@ "dev": true }, "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { - "lcid": "^1.0.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, "os-tmpdir": { @@ -10230,9 +9373,9 @@ "dev": true }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -10254,15 +9397,15 @@ "dev": true }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pako": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", - "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", "dev": true }, "parent-module": { @@ -10275,9 +9418,9 @@ } }, "parse-entities": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.0.tgz", - "integrity": "sha512-XXtDdOPLSB0sHecbEapQi6/58U/ODj/KWfIXmmMCJF/eRn8laX6LZbOyioMoETOOJoWRW8/qTSl5VQkUIfKM5g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.1.tgz", + "integrity": "sha512-NBWYLQm1KSoDKk7GAHyioLTvCZ5QjdH/ASBBQTD3iLiAWJXS5bg1jEWI8nIJ+vgVvsceBVBcDGRWSo0KVQBvvg==", "dev": true, "requires": { "character-entities": "^1.0.0", @@ -10385,13 +9528,6 @@ "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", "requires": { "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - } } }, "path-type": { @@ -10432,9 +9568,9 @@ "dev": true }, "picomatch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.4.tgz", - "integrity": "sha512-lN1llt2d+xBz96Vp+yj0qMUVMyDsqvNSecdRDIEuh72kQi1N6ttkxPJ7zDVwKR4ehD2R3WhMKqdp/5LeRfc+PA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.6.tgz", + "integrity": "sha512-Btng9qVvFsW6FkXYQQK5nEI5i8xdXFDmlKxC7Q8S2Bu5HGWnbQf7ts2kOoxJIrZn5hmw61RZIayAg2zBuJDtyQ==", "dev": true }, "pify": { @@ -10494,9 +9630,9 @@ "dev": true }, "postcss": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.14.tgz", - "integrity": "sha512-NsbD6XUUMZvBxtQAJuWDJeeC4QFsmWsfozWxCJPWf3M55K9iu2iMDaKqyoOdTJ1R4usBXuxlVFAIo8rZPQD4Bg==", + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.16.tgz", + "integrity": "sha512-MOo8zNSlIqh22Uaa3drkdIAgUGEL+AD1ESiSdmElLUmE2uVDo1QloiT/IfW9qRw8Gw+Y/w69UVMGwbufMSftxA==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -10564,6 +9700,12 @@ "postcss": "^5.2.16" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", @@ -10615,6 +9757,15 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", @@ -10803,12 +9954,6 @@ "unified": "6.1.6" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "babel-code-frame": { "version": "7.0.0-beta.3", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-7.0.0-beta.3.tgz", @@ -10861,6 +10006,12 @@ "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, + "emoji-regex": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", + "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -10879,12 +10030,21 @@ "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", @@ -10906,25 +10066,6 @@ "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", "dev": true }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, "supports-color": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", @@ -11043,15 +10184,15 @@ "dev": true }, "q": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, "quick-lru": { "version": "1.1.0", @@ -11105,28 +10246,6 @@ } } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true - } - } - }, "re-resizable": { "version": "4.11.0", "resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-4.11.0.tgz", @@ -11359,6 +10478,14 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } } }, "readdirp": { @@ -11684,6 +10811,15 @@ "mute-stream": "0.0.5" }, "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "mute-stream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", @@ -11723,10 +10859,9 @@ "dev": true }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" }, "regenerator-transform": { "version": "0.10.1", @@ -11988,6 +11123,14 @@ "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + } } }, "require-directory": { @@ -12003,9 +11146,9 @@ "dev": true }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "requireindex": { @@ -12015,10 +11158,13 @@ "dev": true }, "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } }, "resolve-from": { "version": "4.0.0", @@ -12124,9 +11270,9 @@ "dev": true }, "rxjs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", - "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", + "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -12167,6 +11313,148 @@ "lodash": "^4.0.0", "scss-tokenizer": "^0.2.3", "yargs": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } } }, "saucelabs": { @@ -12243,9 +11531,9 @@ } }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "semver-compare": { @@ -12260,6 +11548,12 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -12322,9 +11616,9 @@ "dev": true }, "simple-git": { - "version": "1.107.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.107.0.tgz", - "integrity": "sha512-t4OK1JRlp4ayKRfcW6owrWcRVLyHRUlhGd0uN6ZZTqfDq8a5XpcUdOKiGRNobHEuMtNqzp0vcJNvhYWwh5PsQA==", + "version": "1.112.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.112.0.tgz", + "integrity": "sha512-3vY0SW+RkO+ElWH07n/PQuKmuNLZSz3VAkxKMr3UMm/QnaSnYFjg3nqT8V6a0QCcUFpkyAWVsruQt4oSIIzPXw==", "dev": true, "requires": { "debug": "^4.0.1" @@ -12362,14 +11656,6 @@ "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } } }, "slugs": { @@ -12561,9 +11847,9 @@ } }, "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, "specificity": { @@ -12582,10 +11868,9 @@ } }, "sprintf-js": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-0.0.7.tgz", - "integrity": "sha1-8A14/RYBMICbSrNAwDEPqnElPb0=", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" }, "sshpk": { "version": "1.16.1", @@ -12659,14 +11944,30 @@ "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "string_decoder": { @@ -12702,12 +12003,11 @@ } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", + "integrity": "sha1-32LBqpTtLxFOHQ8h/R1QSCt5pg4=", "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^1.0.0" } }, "strip-bom": { @@ -12808,9 +12108,9 @@ "dev": true }, "braces": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.1.tgz", - "integrity": "sha512-Vmyh3JAr5DRUKCdRrC+WyAAsWBez8HLnBmVb6Ux2VYbvC8DjqMC228WHx24fiQG5BiDOVo+otK1scdkK5S6YNg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" @@ -12833,18 +12133,6 @@ "quick-lru": "^1.0.0" } }, - "cosmiconfig": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz", - "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.0", - "parse-json": "^4.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -12909,29 +12197,11 @@ } }, "ignore": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.0.tgz", - "integrity": "sha512-dJEmMwloo0gq40chdtDmE4tMp67ZGwN7MFTgjNqWi2VHEi5Ya6JkuvPWasjcAIm7lg+2if8xxn5R199wspcplg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz", + "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==", "dev": true }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -12950,16 +12220,6 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -13020,13 +12280,13 @@ } }, "micromatch": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.1.tgz", - "integrity": "sha512-6yawNHAc4S9Dh81xZCkZ5sXKH0/ly0t1DiOc+rnqzi0OvwS4DgRZU+HYTNDIgULgZXTNw5N8Vhxh2va8nEO6BA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "requires": { "braces": "^3.0.1", - "picomatch": "^2.0.3" + "picomatch": "^2.0.5" } }, "ms": { @@ -13216,6 +12476,15 @@ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } } } }, @@ -13226,12 +12495,12 @@ "dev": true }, "stylelint-config-recommended-scss": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-3.2.0.tgz", - "integrity": "sha512-M8BFHMRf8KNz5EQPKJd8nMCGmBd2o5coDEObfHVbEkyLDgjIf1V+U5dHjaGgvhm0zToUxshxN+Gc5wpbOOew4g==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-3.3.0.tgz", + "integrity": "sha512-BvuuLYwoet8JutOP7K1a8YaiENN+0HQn390eDi0SWe1h7Uhx6O3GUQ6Ubgie9b/AmHX4Btmp+ZzVGbzriFTBcA==", "dev": true, "requires": { - "stylelint-config-recommended": "^2.0.0" + "stylelint-config-recommended": "^2.2.0" } }, "stylelint-config-wordpress": { @@ -13246,9 +12515,9 @@ } }, "stylelint-scss": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.6.0.tgz", - "integrity": "sha512-Qpw0gl6iLBon5JNeFZjVYOEayd/e+WYIdY2vFhZuXeHC6jb8wl0wRZY97jATt/uxZzdtU3tGLAvJOUMuFp18vw==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.6.1.tgz", + "integrity": "sha512-6bB2EHUZsE/bDVKUdzBXqOcfgXmg3zq9Lglgbu16EqMa4PM8Y48XKcB8coOj8CKr07GtlqtOdCNA2E5njoI9Kw==", "dev": true, "requires": { "lodash": "^4.17.11", @@ -13301,9 +12570,9 @@ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, "synchronous-promise": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.6.tgz", - "integrity": "sha512-TyOuWLwkmtPL49LHCX1caIwHjRzcVd62+GF6h8W/jHOeZUFHpnd2XJDVuUlaTaLPH1nuu2M69mfHr5XbQJnf/g==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.7.tgz", + "integrity": "sha512-16GbgwTmFMYFyQMLvtQjvNWh30dsFe1cAW5Fg1wm5+dg84L9Pe36mftsIRU95/W2YsISxsz/xq4VB23sqpgb/A==", "dev": true }, "table": { @@ -13318,36 +12587,12 @@ "string-width": "^3.0.0" }, "dependencies": { - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -13379,19 +12624,14 @@ } }, "tar": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, - "optional": true, "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" } }, "tcp-port-used": { @@ -13705,23 +12945,13 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.11.tgz", + "integrity": "sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg==", "dev": true, - "optional": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.20.0", "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true, - "optional": true - } } }, "underscore.string": { @@ -13732,14 +12962,6 @@ "requires": { "sprintf-js": "^1.0.3", "util-deprecate": "^1.0.2" - }, - "dependencies": { - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true - } } }, "unherit": { @@ -13906,6 +13128,12 @@ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -14091,9 +13319,9 @@ } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wide-align": { @@ -14122,14 +13350,6 @@ "selenium-webdriver": "^3.6.0", "sprintf-js": "^1.0.3", "wp-e2e-webdriver": "^0.14.0" - }, - "dependencies": { - "sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", - "dev": true - } } }, "wp-e2e-webdriver": { @@ -14178,22 +13398,6 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -14255,68 +13459,87 @@ "dev": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", "dev": true, "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^4.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" }, "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "camelcase": "^3.0.0" + "locate-path": "^3.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" } } } }, "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", "dev": true, "requires": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "dependencies": { "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } @@ -14332,29 +13555,12 @@ "yargs": "^12.0.5" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -14364,127 +13570,18 @@ "locate-path": "^3.0.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, "yargs": { "version": "12.0.5", "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", @@ -14527,16 +13624,16 @@ } }, "yup": { - "version": "0.26.10", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.26.10.tgz", - "integrity": "sha512-keuNEbNSnsOTOuGCt3UJW69jDE3O4P+UHAakO7vSeFMnjaitcmlbij/a3oNb9g1Y1KvSKH/7O1R2PQ4m4TRylw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz", + "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==", "dev": true, "requires": { - "@babel/runtime": "7.0.0", + "@babel/runtime": "^7.0.0", "fn-name": "~2.0.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "property-expr": "^1.5.0", - "synchronous-promise": "^2.0.5", + "synchronous-promise": "^2.0.6", "toposort": "^2.0.2" } } diff --git a/package.json b/package.json index 57944e4caff..0085a25ec59 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "grunt-wp-i18n": "1.0.3", "husky": "2.2.0", "istanbul": "1.0.0-alpha.2", - "lint-staged": "8.1.5", + "lint-staged": "8.1.6", "mocha": "6.1.4", "node-sass": "4.12.0", "prettier": "github:automattic/calypso-prettier#c56b4251", diff --git a/readme.txt b/readme.txt index 5f3b7b84336..a9e3d3d6bfb 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: automattic, mikejolley, jameskoster, claudiosanches, claudiulodro, kloon, rodrigosprimo, jshreve, coderkevin Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloadable, downloads, payments, paypal, storefront, stripe, woo commerce, woo Requires at least: 4.7 -Tested up to: 5.1 +Tested up to: 5.2 Stable tag: 3.6.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -60,7 +60,7 @@ There are also extensions available to add [delivery and shipping options](https = Design your store with themes and blocks = -WooCommerce store design starts with a theme of your choice. There are hundreds of free and paid themes available, including [Storefront](https://woocommerce.com/storefront/?utm_source=wp%20org%20repo%20listing&utm_content=3.6) by Automattic -- it's free to all stores and you can choose to have it installed for you during the hguided setup. +WooCommerce store design starts with a theme of your choice. There are hundreds of free and paid themes available, including [Storefront](https://woocommerce.com/storefront/?utm_source=wp%20org%20repo%20listing&utm_content=3.6) by Automattic -- it's free to all stores and you can choose to have it installed for you during the guided setup. Storefront offers deep WooCommerce integration and prioritizes speed and uptime. You can add your brand and define your style by customizing Storefront yourself or adding one of several industry-themed [Storefront child themes](https://woocommerce.com/product-category/themes/storefront-child-theme-themes/?utm_source=wp%20org%20repo%20listing&utm_content=3.6). @@ -104,7 +104,7 @@ There are 80+ [WooCommerce Meetups](https://woocommerce.com/woocommerce/meetups/ If you’re interested in contributing to WooCommerce we’ve got more than 350 contributors, and there’s always room for more. Head to the [WooCommerce GitHub Repository](https://github.com/woocommerce/woocommerce?utm_source=wp%20org%20repo%20listing&utm_content=3.6) to find out how you can pitch in. -WooCommerce is currently 100% translated into 24 languages, including Danish, Ukranian, and Persian. If you’re interested in helping to localize WooCommerce by adding your local language, visit [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/woocommerce?utm_source=wp%20org%20repo%20listing&utm_content=3.6). +WooCommerce is currently 100% translated into 24 languages, including Danish, Ukrainian, and Persian. If you’re interested in helping to localize WooCommerce by adding your local language, visit [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/woocommerce?utm_source=wp%20org%20repo%20listing&utm_content=3.6). == Frequently Asked Questions == @@ -154,7 +154,7 @@ Visit the [WooCommerce server requirements documentation](https://docs.woocommer Automatic installation is the easiest option -- WordPress will handles the file transfer, and you won’t need to leave your web browser. To do an automatic install of WooCommerce, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.” -In the search field type “WooCommerce,” then click “Search Plugins.” Once you’ve found us, you can view details about it such as the point release, rating, and description. Most importantly of course, you can install it by! Clicki “Install Now,” and WordPress will take it from there. +In the search field type “WooCommerce,” then click “Search Plugins.” Once you’ve found us, you can view details about it such as the point release, rating, and description. Most importantly of course, you can install it by! Click “Install Now,” and WordPress will take it from there. = Manual installation = diff --git a/tests/framework/class-wc-api-unit-test-case.php b/tests/framework/class-wc-api-unit-test-case.php index cd820fe9ece..afe255a8eaf 100644 --- a/tests/framework/class-wc-api-unit-test-case.php +++ b/tests/framework/class-wc-api-unit-test-case.php @@ -40,10 +40,10 @@ class WC_API_Unit_Test_Case extends WC_Unit_Test_Case { * Assert the given response is an API error with a specific code and status. * * @since 2.2 - * @param string $code error code, e.g. `woocommerce_api_user_cannot_read_orders_count` + * @param string $code error code, e.g. `woocommerce_api_user_cannot_read_orders_count` * @param int|null $status HTTP status code associated with error, e.g. 400 * @param WP_Error $response - * @param string $message optional message to render when assertion fails + * @param string $message optional message to render when assertion fails */ public function assertHasAPIError( $code, $status = null, $response, $message = '' ) { diff --git a/tests/framework/class-wc-mock-wc-data.php b/tests/framework/class-wc-mock-wc-data.php index 7dd26e05bb6..b3eb6db77e3 100644 --- a/tests/framework/class-wc-mock-wc-data.php +++ b/tests/framework/class-wc-mock-wc-data.php @@ -1,9 +1,9 @@ get_id(); if ( 'user' === $this->meta_type ) { - wp_update_user( array( 'ID' => $customer_id, 'user_email' => $object->get_content() ) ); + wp_update_user( + array( + 'ID' => $customer_id, + 'user_email' => $object->get_content(), + ) + ); } else { - wp_update_post( array( 'ID' => $content_id, 'post_title' => $object->get_content() ) ); + wp_update_post( + array( + 'ID' => $content_id, + 'post_title' => $object->get_content(), + ) + ); } } @@ -132,7 +142,7 @@ class WC_Mock_WC_Data extends WC_Data { $this->set_object_read( true ); } - $this->data_store = new WC_Mock_WC_Data_Store; + $this->data_store = new WC_Mock_WC_Data_Store(); if ( $this->get_id() > 0 ) { $this->data_store->read( $this ); diff --git a/tests/framework/class-wc-rest-unit-test-case.php b/tests/framework/class-wc-rest-unit-test-case.php index 70a05334751..5ad76c053e7 100644 --- a/tests/framework/class-wc-rest-unit-test-case.php +++ b/tests/framework/class-wc-rest-unit-test-case.php @@ -22,7 +22,7 @@ class WC_REST_Unit_Test_Case extends WC_Unit_Test_Case { do_action( 'rest_api_init' ); // Reset payment gateways. - $gateways = WC_Payment_Gateways::instance(); + $gateways = WC_Payment_Gateways::instance(); $gateways->payment_gateways = array(); $gateways->init(); } diff --git a/tests/framework/helpers/class-wc-helper-coupon.php b/tests/framework/helpers/class-wc-helper-coupon.php index 25a667cafa6..15d5f403740 100644 --- a/tests/framework/helpers/class-wc-helper-coupon.php +++ b/tests/framework/helpers/class-wc-helper-coupon.php @@ -19,32 +19,37 @@ class WC_Helper_Coupon { */ public static function create_coupon( $coupon_code = 'dummycoupon', $meta = array() ) { // Insert post - $coupon_id = wp_insert_post( array( - 'post_title' => $coupon_code, - 'post_type' => 'shop_coupon', - 'post_status' => 'publish', - 'post_excerpt' => 'This is a dummy coupon', - ) ); + $coupon_id = wp_insert_post( + array( + 'post_title' => $coupon_code, + 'post_type' => 'shop_coupon', + 'post_status' => 'publish', + 'post_excerpt' => 'This is a dummy coupon', + ) + ); - $meta = wp_parse_args( $meta, array( - 'discount_type' => 'fixed_cart', - 'coupon_amount' => '1', - 'individual_use' => 'no', - 'product_ids' => '', - 'exclude_product_ids' => '', - 'usage_limit' => '', - 'usage_limit_per_user' => '', - 'limit_usage_to_x_items' => '', - 'expiry_date' => '', - 'free_shipping' => 'no', - 'exclude_sale_items' => 'no', - 'product_categories' => array(), - 'exclude_product_categories' => array(), - 'minimum_amount' => '', - 'maximum_amount' => '', - 'customer_email' => array(), - 'usage_count' => '0', - ) ); + $meta = wp_parse_args( + $meta, + array( + 'discount_type' => 'fixed_cart', + 'coupon_amount' => '1', + 'individual_use' => 'no', + 'product_ids' => '', + 'exclude_product_ids' => '', + 'usage_limit' => '', + 'usage_limit_per_user' => '', + 'limit_usage_to_x_items' => '', + 'expiry_date' => '', + 'free_shipping' => 'no', + 'exclude_sale_items' => 'no', + 'product_categories' => array(), + 'exclude_product_categories' => array(), + 'minimum_amount' => '', + 'maximum_amount' => '', + 'customer_email' => array(), + 'usage_count' => '0', + ) + ); // Update meta. foreach ( $meta as $key => $value ) { diff --git a/tests/framework/helpers/class-wc-helper-customer.php b/tests/framework/helpers/class-wc-helper-customer.php index 503994b46e2..fe6b9ba644d 100644 --- a/tests/framework/helpers/class-wc-helper-customer.php +++ b/tests/framework/helpers/class-wc-helper-customer.php @@ -14,25 +14,25 @@ class WC_Helper_Customer { */ public static function create_mock_customer() { $customer_data = array( - 'id' => 0, - 'date_modified' => null, - 'country' => 'US', - 'state' => 'PA', - 'postcode' => '19123', - 'city' => 'Philadelphia', - 'address' => '123 South Street', - 'address_2' => 'Apt 1', - 'shipping_country' => 'US', - 'shipping_state' => 'PA', - 'shipping_postcode' => '19123', - 'shipping_city' => 'Philadelphia', - 'shipping_address' => '123 South Street', - 'shipping_address_2' => 'Apt 1', - 'is_vat_exempt' => false, - 'calculated_shipping' => false, + 'id' => 0, + 'date_modified' => null, + 'country' => 'US', + 'state' => 'PA', + 'postcode' => '19123', + 'city' => 'Philadelphia', + 'address' => '123 South Street', + 'address_2' => 'Apt 1', + 'shipping_country' => 'US', + 'shipping_state' => 'PA', + 'shipping_postcode' => '19123', + 'shipping_city' => 'Philadelphia', + 'shipping_address' => '123 South Street', + 'shipping_address_2' => 'Apt 1', + 'is_vat_exempt' => false, + 'calculated_shipping' => false, ); - WC_Helper_Customer::set_customer_details( $customer_data ); + self::set_customer_details( $customer_data ); $customer = new WC_Customer( 0, true ); @@ -70,7 +70,7 @@ class WC_Helper_Customer { * @return array */ public static function get_expected_store_location() { - return array( "GB", "", "", "" ); + return array( 'GB', '', '', '' ); } /** diff --git a/tests/framework/helpers/class-wc-helper-order.php b/tests/framework/helpers/class-wc-helper-order.php index 329b02efc43..720c2773155 100644 --- a/tests/framework/helpers/class-wc-helper-order.php +++ b/tests/framework/helpers/class-wc-helper-order.php @@ -54,16 +54,18 @@ class WC_Helper_Order { ); $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; // Required, else wc_create_order throws an exception - $order = wc_create_order( $order_data ); + $order = wc_create_order( $order_data ); // Add order products $item = new WC_Order_Item_Product(); - $item->set_props( array( - 'product' => $product, - 'quantity' => 4, - 'subtotal' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), - 'total' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), - ) ); + $item->set_props( + array( + 'product' => $product, + 'quantity' => 4, + 'subtotal' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), + 'total' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), + ) + ); $item->save(); $order->add_item( $item ); @@ -82,14 +84,16 @@ class WC_Helper_Order { // Add shipping costs $shipping_taxes = WC_Tax::calc_shipping_tax( '10', WC_Tax::get_shipping_tax_rates() ); - $rate = new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', $shipping_taxes, 'flat_rate' ); - $item = new WC_Order_Item_Shipping(); - $item->set_props( array( - 'method_title' => $rate->label, - 'method_id' => $rate->id, - 'total' => wc_format_decimal( $rate->cost ), - 'taxes' => $rate->taxes, - ) ); + $rate = new WC_Shipping_Rate( 'flat_rate_shipping', 'Flat rate shipping', '10', $shipping_taxes, 'flat_rate' ); + $item = new WC_Order_Item_Shipping(); + $item->set_props( + array( + 'method_title' => $rate->label, + 'method_id' => $rate->id, + 'total' => wc_format_decimal( $rate->cost ), + 'taxes' => $rate->taxes, + ) + ); foreach ( $rate->get_meta_data() as $key => $value ) { $item->add_meta_data( $key, $value, true ); } diff --git a/tests/framework/helpers/class-wc-helper-product.php b/tests/framework/helpers/class-wc-helper-product.php index 54b3dfe8b03..fae7d04ad0a 100644 --- a/tests/framework/helpers/class-wc-helper-product.php +++ b/tests/framework/helpers/class-wc-helper-product.php @@ -90,8 +90,8 @@ class WC_Helper_Product { $product = new WC_Product_Grouped(); $product->set_props( array( - 'name' => 'Dummy Grouped Product', - 'sku' => 'DUMMY GROUPED SKU', + 'name' => 'Dummy Grouped Product', + 'sku' => 'DUMMY GROUPED SKU', ) ); $product->set_children( array( $simple_product_1->get_id(), $simple_product_2->get_id() ) ); @@ -235,7 +235,7 @@ class WC_Helper_Product { $result = term_exists( $term, $attribute->slug ); if ( ! $result ) { - $result = wp_insert_term( $term, $attribute->slug ); + $result = wp_insert_term( $term, $attribute->slug ); $return['term_ids'][] = $result['term_id']; } else { $return['term_ids'][] = $result['term_id']; diff --git a/tests/framework/helpers/class-wc-helper-settings.php b/tests/framework/helpers/class-wc-helper-settings.php index 765c5f78ab5..ac0a30ba4ea 100644 --- a/tests/framework/helpers/class-wc-helper-settings.php +++ b/tests/framework/helpers/class-wc-helper-settings.php @@ -40,13 +40,13 @@ class WC_Helper_Settings { 'option_key' => '', ); $groups[] = array( - 'id' => 'coupon-data', - 'label' => 'Coupon data', - 'option_key' => '', + 'id' => 'coupon-data', + 'label' => 'Coupon data', + 'option_key' => '', ); $groups[] = array( - 'id' => 'invalid', - 'option_key' => '', + 'id' => 'invalid', + 'option_key' => '', ); return $groups; } diff --git a/tests/includes/wp-http-testcase.php b/tests/includes/wp-http-testcase.php index b1d8a4d7c8d..4f6effd5a97 100644 --- a/tests/includes/wp-http-testcase.php +++ b/tests/includes/wp-http-testcase.php @@ -203,7 +203,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { public function http_request_listner( $preempt, $request, $url ) { $this->http_requests[] = array( - 'url' => $url, + 'url' => $url, 'request' => $request, ); @@ -256,7 +256,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { * * @since 1.1.0 * - * @param array $request The request. + * @param array $request The request. * @param string $url The URL the request is for. * * @return string|false The cache key for the request. False if not caching. @@ -315,7 +315,7 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { } self::$cache[ $cache_key ] = $response; - self::$cache_changed = true; + self::$cache_changed = true; } // @@ -428,7 +428,8 @@ abstract class WP_HTTP_TestCase extends WP_UnitTestCase { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_file_put_contents file_put_contents( - self::$cache_dir . '/' . self::$cache_group, serialize( self::$cache ) + self::$cache_dir . '/' . self::$cache_group, + serialize( self::$cache ) ); } } diff --git a/tests/unit-tests/account/functions.php b/tests/unit-tests/account/functions.php index 3d95b85791d..c2fb43e9bdd 100644 --- a/tests/unit-tests/account/functions.php +++ b/tests/unit-tests/account/functions.php @@ -45,14 +45,17 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_get_account_menu_items() { - $this->assertEquals( array( - 'dashboard' => 'Dashboard', - 'orders' => 'Orders', - 'downloads' => 'Downloads', - 'edit-address' => 'Addresses', - 'edit-account' => 'Account details', - 'customer-logout' => 'Logout', - ), wc_get_account_menu_items() ); + $this->assertEquals( + array( + 'dashboard' => 'Dashboard', + 'orders' => 'Orders', + 'downloads' => 'Downloads', + 'edit-address' => 'Addresses', + 'edit-account' => 'Account details', + 'customer-logout' => 'Logout', + ), + wc_get_account_menu_items() + ); } /** @@ -79,13 +82,16 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_get_account_orders_columns() { - $this->assertEquals( array( - 'order-number' => 'Order', - 'order-date' => 'Date', - 'order-status' => 'Status', - 'order-total' => 'Total', - 'order-actions' => 'Actions', - ), wc_get_account_orders_columns() ); + $this->assertEquals( + array( + 'order-number' => 'Order', + 'order-date' => 'Date', + 'order-status' => 'Status', + 'order-total' => 'Total', + 'order-actions' => 'Actions', + ), + wc_get_account_orders_columns() + ); } /** @@ -94,12 +100,15 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_get_account_downloads_columns() { - $this->assertEquals( array( - 'download-file' => 'Download', - 'download-remaining' => 'Downloads remaining', - 'download-expires' => 'Expires', - 'download-product' => 'Product', - ), wc_get_account_downloads_columns() ); + $this->assertEquals( + array( + 'download-file' => 'Download', + 'download-remaining' => 'Downloads remaining', + 'download-expires' => 'Expires', + 'download-product' => 'Product', + ), + wc_get_account_downloads_columns() + ); } /** @@ -108,11 +117,14 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { * @since 3.3.0 */ public function test_wc_get_account_payment_methods_columns() { - $this->assertEquals( array( - 'method' => 'Method', - 'expires' => 'Expires', - 'actions' => ' ', - ), wc_get_account_payment_methods_columns() ); + $this->assertEquals( + array( + 'method' => 'Method', + 'expires' => 'Expires', + 'actions' => ' ', + ), + wc_get_account_payment_methods_columns() + ); } /** @@ -121,10 +133,13 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { * @since 3.3.0 */ public function test_wc_get_account_payment_methods_types() { - $this->assertEquals( array( - 'cc' => 'Credit card', - 'echeck' => 'eCheck', - ), wc_get_account_payment_methods_types() ); + $this->assertEquals( + array( + 'cc' => 'Credit card', + 'echeck' => 'eCheck', + ), + wc_get_account_payment_methods_types() + ); } /** @@ -135,20 +150,23 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { public function test_wc_get_account_orders_actions() { $order = WC_Helper_Order::create_order(); - $this->assertEquals( array( - 'view' => array( - 'url' => $order->get_view_order_url(), - 'name' => 'View', + $this->assertEquals( + array( + 'view' => array( + 'url' => $order->get_view_order_url(), + 'name' => 'View', + ), + 'pay' => array( + 'url' => $order->get_checkout_payment_url(), + 'name' => 'Pay', + ), + 'cancel' => array( + 'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ), + 'name' => 'Cancel', + ), ), - 'pay' => array( - 'url' => $order->get_checkout_payment_url(), - 'name' => 'Pay', - ), - 'cancel' => array( - 'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ), - 'name' => 'Cancel', - ), - ), wc_get_account_orders_actions( $order->get_id() ) ); + wc_get_account_orders_actions( $order->get_id() ) + ); $order->delete( true ); } @@ -187,25 +205,28 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { $delete_url = wc_get_endpoint_url( 'delete-payment-method', $token->get_id() ); $delete_url = wp_nonce_url( $delete_url, 'delete-payment-method-' . $token->get_id() ); - $this->assertEquals( array( - 'cc' => array( - array( - 'method' => array( - 'gateway' => 'bacs', - 'last4' => '1234', - 'brand' => 'Mastercard', - ), - 'expires' => '12/20', - 'is_default' => true, - 'actions' => array( - 'delete' => array( - 'url' => $delete_url, - 'name' => 'Delete', + $this->assertEquals( + array( + 'cc' => array( + array( + 'method' => array( + 'gateway' => 'bacs', + 'last4' => '1234', + 'brand' => 'Mastercard', + ), + 'expires' => '12/20', + 'is_default' => true, + 'actions' => array( + 'delete' => array( + 'url' => $delete_url, + 'name' => 'Delete', + ), ), ), ), ), - ), wc_get_account_saved_payment_methods_list( array(), $customer->get_id() ) ); + wc_get_account_saved_payment_methods_list( array(), $customer->get_id() ) + ); $customer->delete( true ); $token->delete( true ); @@ -226,13 +247,16 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { $token->set_expiry_year( '2020' ); $token->save(); - $this->assertEquals( array( - 'method' => array( - 'last4' => '1234', - 'brand' => 'Mastercard', + $this->assertEquals( + array( + 'method' => array( + 'last4' => '1234', + 'brand' => 'Mastercard', + ), + 'expires' => '12/20', ), - 'expires' => '12/20', - ), wc_get_account_saved_payment_methods_list_item_cc( array(), $token ) ); + wc_get_account_saved_payment_methods_list_item_cc( array(), $token ) + ); $token->delete( true ); } @@ -249,12 +273,15 @@ class WC_Tests_Account_Functions extends WC_Unit_Test_Case { $token->set_last4( '1234' ); $token->save(); - $this->assertEquals( array( - 'method' => array( - 'last4' => '1234', - 'brand' => 'eCheck', + $this->assertEquals( + array( + 'method' => array( + 'last4' => '1234', + 'brand' => 'eCheck', + ), ), - ), wc_get_account_saved_payment_methods_list_item_echeck( array(), $token ) ); + wc_get_account_saved_payment_methods_list_item_echeck( array(), $token ) + ); $token->delete( true ); } diff --git a/tests/unit-tests/admin/reports/class-wc-tests-admin-report.php b/tests/unit-tests/admin/reports/class-wc-tests-admin-report.php index fdb01d085af..332e0630399 100644 --- a/tests/unit-tests/admin/reports/class-wc-tests-admin-report.php +++ b/tests/unit-tests/admin/reports/class-wc-tests-admin-report.php @@ -31,20 +31,22 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { * Test: get_order_report_data */ public function test_get_order_report_data() { - $order = WC_Helper_Order::create_order(); + $order = WC_Helper_Order::create_order(); $order->set_status( 'completed' ); $order->save(); $report = new WC_Admin_Report(); - $data = $report->get_order_report_data( array( - 'data' => array( - 'ID' => array( - 'type' => 'post_data', - 'function' => 'COUNT', - 'name' => 'total_orders', + $data = $report->get_order_report_data( + array( + 'data' => array( + 'ID' => array( + 'type' => 'post_data', + 'function' => 'COUNT', + 'name' => 'total_orders', + ), ), - ), - ) ); + ) + ); $this->assertEquals( 1, $data->total_orders, 'Expected to see one completed order in the report.' ); WC_Admin_Report::maybe_update_transients(); @@ -66,20 +68,22 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { * Test: get_order_report_data */ public function test_get_order_report_data_for_post_meta() { - $order = WC_Helper_Order::create_order(); + $order = WC_Helper_Order::create_order(); $order->set_status( 'completed' ); $order->save(); $report = new WC_Admin_Report(); - $data = $report->get_order_report_data( array( - 'data' => array( - '_billing_first_name' => array( - 'type' => 'meta', - 'function' => null, - 'name' => 'customer_name', + $data = $report->get_order_report_data( + array( + 'data' => array( + '_billing_first_name' => array( + 'type' => 'meta', + 'function' => null, + 'name' => 'customer_name', + ), ), - ), - ) ); + ) + ); $this->assertEquals( $order->get_billing_first_name(), $data->customer_name ); } @@ -89,20 +93,24 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { */ public function test_get_order_report_data_for_parent_meta() { $order = WC_Helper_Order::create_order(); - $refund = wc_create_refund( array( - 'order_id' => $order->get_id(), - ) ); + $refund = wc_create_refund( + array( + 'order_id' => $order->get_id(), + ) + ); $report = new WC_Admin_Report(); - $data = $report->get_order_report_data( array( - 'data' => array( - '_order_total' => array( - 'type' => 'parent_meta', - 'function' => '', - 'name' => 'total_refund', + $data = $report->get_order_report_data( + array( + 'data' => array( + '_order_total' => array( + 'type' => 'parent_meta', + 'function' => '', + 'name' => 'total_refund', + ), ), - ), - ) ); + ) + ); $this->assertEquals( $order->get_total(), $data->total_refund ); } @@ -111,20 +119,22 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { * Test: get_order_report_data */ public function test_get_order_report_data_for_post_data() { - $order = WC_Helper_Order::create_order(); + $order = WC_Helper_Order::create_order(); $order->set_status( 'completed' ); $order->save(); $report = new WC_Admin_Report(); - $data = $report->get_order_report_data( array( - 'data' => array( - 'post_status' => array( - 'type' => 'post_data', - 'function' => null, - 'name' => 'post_status', + $data = $report->get_order_report_data( + array( + 'data' => array( + 'post_status' => array( + 'type' => 'post_data', + 'function' => null, + 'name' => 'post_status', + ), ), - ), - ) ); + ) + ); $this->assertEquals( 'wc-completed', $data->post_status ); } @@ -139,15 +149,17 @@ class WC_Tests_Admin_Report extends WC_Unit_Test_Case { $order->save(); $report = new WC_Admin_Report(); - $data = $report->get_order_report_data( array( - 'data' => array( - 'order_item_name' => array( - 'type' => 'order_item', - 'function' => null, - 'name' => 'name', + $data = $report->get_order_report_data( + array( + 'data' => array( + 'order_item_name' => array( + 'type' => 'order_item', + 'function' => null, + 'name' => 'name', + ), ), - ), - ) ); + ) + ); $this->assertEquals( $product->get_name(), $data->name ); } diff --git a/tests/unit-tests/api/coupons.php b/tests/unit-tests/api/coupons.php index 3953aef7044..40f9eaee25f 100644 --- a/tests/unit-tests/api/coupons.php +++ b/tests/unit-tests/api/coupons.php @@ -15,9 +15,11 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Coupons_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -43,51 +45,54 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/coupons' ) ); - $coupons = $response->get_data(); + $coupons = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $coupons ) ); - $this->assertContains( array( - 'id' => $coupon_1->get_id(), - 'code' => 'dummycoupon-1', - 'amount' => '1.00', - 'date_created' => wc_rest_prepare_date_response( $post_1->post_date_gmt, false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $post_1->post_date_gmt ), - 'date_modified' => wc_rest_prepare_date_response( $post_1->post_modified_gmt, false ), - 'date_modified_gmt' => wc_rest_prepare_date_response( $post_1->post_modified_gmt ), - 'discount_type' => 'fixed_cart', - 'description' => 'This is a dummy coupon', - 'date_expires' => '', - 'date_expires_gmt' => '', - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => '', - 'usage_limit_per_user' => '', - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v3/coupons/' . $coupon_1->get_id() ), + $this->assertContains( + array( + 'id' => $coupon_1->get_id(), + 'code' => 'dummycoupon-1', + 'amount' => '1.00', + 'date_created' => wc_rest_prepare_date_response( $post_1->post_date_gmt, false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $post_1->post_date_gmt ), + 'date_modified' => wc_rest_prepare_date_response( $post_1->post_modified_gmt, false ), + 'date_modified_gmt' => wc_rest_prepare_date_response( $post_1->post_modified_gmt ), + 'discount_type' => 'fixed_cart', + 'description' => 'This is a dummy coupon', + 'date_expires' => '', + 'date_expires_gmt' => '', + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => '', + 'usage_limit_per_user' => '', + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v3/coupons/' . $coupon_1->get_id() ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v3/coupons' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v3/coupons' ), + ), ), ), ), - ), $coupons ); + $coupons + ); } /** @@ -112,35 +117,38 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => $coupon->get_id(), - 'code' => 'dummycoupon-1', - 'amount' => '1.00', - 'date_created' => wc_rest_prepare_date_response( $post->post_date_gmt, false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $post->post_date_gmt ), - 'date_modified' => wc_rest_prepare_date_response( $post->post_modified_gmt, false ), - 'date_modified_gmt' => wc_rest_prepare_date_response( $post->post_modified_gmt ), - 'discount_type' => 'fixed_cart', - 'description' => 'This is a dummy coupon', - 'date_expires' => null, - 'date_expires_gmt' => null, - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => null, - 'usage_limit_per_user' => null, - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - ), $data ); + $this->assertEquals( + array( + 'id' => $coupon->get_id(), + 'code' => 'dummycoupon-1', + 'amount' => '1.00', + 'date_created' => wc_rest_prepare_date_response( $post->post_date_gmt, false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $post->post_date_gmt ), + 'date_modified' => wc_rest_prepare_date_response( $post->post_modified_gmt, false ), + 'date_modified_gmt' => wc_rest_prepare_date_response( $post->post_modified_gmt ), + 'discount_type' => 'fixed_cart', + 'description' => 'This is a dummy coupon', + 'date_expires' => null, + 'date_expires_gmt' => null, + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => null, + 'usage_limit_per_user' => null, + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + ), + $data + ); } /** @@ -171,46 +179,51 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { public function test_create_coupon() { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'POST', '/wc/v3/coupons' ); - $request->set_body_params( array( - 'code' => 'test', - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - 'description' => 'Test', - 'usage_limit' => 10, - ) ); + $request->set_body_params( + array( + 'code' => 'test', + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + 'description' => 'Test', + 'usage_limit' => 10, + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 201, $response->get_status() ); - $this->assertEquals( array( - 'id' => $data['id'], - 'code' => 'test', - 'amount' => '5.00', - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'discount_type' => 'fixed_product', - 'description' => 'Test', - 'date_expires' => null, - 'date_expires_gmt' => null, - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => 10, - 'usage_limit_per_user' => null, - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - ), $data ); + $this->assertEquals( + array( + 'id' => $data['id'], + 'code' => 'test', + 'amount' => '5.00', + 'date_created' => $data['date_created'], + 'date_created_gmt' => $data['date_created_gmt'], + 'date_modified' => $data['date_modified'], + 'date_modified_gmt' => $data['date_modified_gmt'], + 'discount_type' => 'fixed_product', + 'description' => 'Test', + 'date_expires' => null, + 'date_expires_gmt' => null, + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => 10, + 'usage_limit_per_user' => null, + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + ), + $data + ); } /** @@ -222,12 +235,14 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { // test no code... $request = new WP_REST_Request( 'POST', '/wc/v3/coupons' ); - $request->set_body_params( array( - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - ) ); + $request->set_body_params( + array( + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 400, $response->get_status() ); } @@ -241,13 +256,15 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { // test no code... $request = new WP_REST_Request( 'POST', '/wc/v3/coupons' ); - $request->set_body_params( array( - 'code' => 'fail', - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - ) ); + $request->set_body_params( + array( + 'code' => 'fail', + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 401, $response->get_status() ); } @@ -258,8 +275,8 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { */ public function test_update_coupon() { wp_set_current_user( $this->user ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $post = get_post( $coupon->get_id() ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $post = get_post( $coupon->get_id() ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/coupons/' . $coupon->get_id() ) ); $data = $response->get_data(); @@ -268,12 +285,14 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { $this->assertEquals( '1.00', $data['amount'] ); $request = new WP_REST_Request( 'PUT', '/wc/v3/coupons/' . $coupon->get_id() ); - $request->set_body_params( array( - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '10.00', $data['amount'] ); $this->assertEquals( 'New description', $data['description'] ); @@ -288,13 +307,15 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'PUT', '/wc/v3/coupons/0' ); - $request->set_body_params( array( - 'code' => 'tester', - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'code' => 'tester', + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 400, $response->get_status() ); } @@ -305,14 +326,16 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { */ public function test_update_coupon_without_permission() { wp_set_current_user( 0 ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $post = get_post( $coupon->get_id() ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $post = get_post( $coupon->get_id() ); $request = new WP_REST_Request( 'PUT', '/wc/v3/coupons/' . $coupon->get_id() ); - $request->set_body_params( array( - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); @@ -324,7 +347,7 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { */ public function test_delete_coupon() { wp_set_current_user( $this->user ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); $request = new WP_REST_Request( 'DELETE', '/wc/v3/coupons/' . $coupon->get_id() ); $request->set_param( 'force', true ); $response = $this->server->dispatch( $request ); @@ -364,32 +387,34 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { public function test_batch_coupon() { wp_set_current_user( $this->user ); - $coupon_1 = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); - $coupon_3 = WC_Helper_Coupon::create_coupon( 'dummycoupon-3' ); - $coupon_4 = WC_Helper_Coupon::create_coupon( 'dummycoupon-4' ); + $coupon_1 = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); + $coupon_3 = WC_Helper_Coupon::create_coupon( 'dummycoupon-3' ); + $coupon_4 = WC_Helper_Coupon::create_coupon( 'dummycoupon-4' ); $request = new WP_REST_Request( 'POST', '/wc/v3/coupons/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => $coupon_1->get_id(), - 'amount' => '5.15', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => $coupon_1->get_id(), + 'amount' => '5.15', + ), ), - ), - 'delete' => array( - $coupon_2->get_id(), - $coupon_3->get_id(), - ), - 'create' => array( - array( - 'code' => 'new-coupon', - 'amount' => '11.00', + 'delete' => array( + $coupon_2->get_id(), + $coupon_3->get_id(), ), - ), - ) ); + 'create' => array( + array( + 'code' => 'new-coupon', + 'amount' => '11.00', + ), + ), + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '5.15', $data['update'][0]['amount'] ); $this->assertEquals( '11.00', $data['create'][0]['amount'] ); @@ -397,9 +422,9 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { $this->assertEquals( $coupon_2->get_id(), $data['delete'][0]['id'] ); $this->assertEquals( $coupon_3->get_id(), $data['delete'][1]['id'] ); - $request = new WP_REST_Request( 'GET', '/wc/v3/coupons' ); + $request = new WP_REST_Request( 'GET', '/wc/v3/coupons' ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 3, count( $data ) ); } @@ -410,9 +435,9 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case { */ public function test_coupon_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/coupons' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/coupons' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 27, count( $properties ) ); diff --git a/tests/unit-tests/api/payment-gateways.php b/tests/unit-tests/api/payment-gateways.php index c8752ff91b1..f9a43b64e5f 100644 --- a/tests/unit-tests/api/payment-gateways.php +++ b/tests/unit-tests/api/payment-gateways.php @@ -14,9 +14,11 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Payment_Gateways_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -42,34 +44,40 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { $gateways = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'cheque', - 'title' => 'Check payments', - 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', - 'order' => '', - 'enabled' => false, - 'method_title' => 'Check payments', - 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', - 'method_supports' => array( - 'products', - ), - 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Cheque' ), array( - 'enabled' => false, - 'description' => false, - ) ), - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v3/payment_gateways/cheque' ), - ), + $this->assertContains( + array( + 'id' => 'cheque', + 'title' => 'Check payments', + 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', + 'order' => '', + 'enabled' => false, + 'method_title' => 'Check payments', + 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', + 'method_supports' => array( + 'products', ), - 'collection' => array( + 'settings' => array_diff_key( + $this->get_settings( 'WC_Gateway_Cheque' ), array( - 'href' => rest_url( '/wc/v3/payment_gateways' ), + 'enabled' => false, + 'description' => false, + ) + ), + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v3/payment_gateways/cheque' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v3/payment_gateways' ), + ), ), ), ), - ), $gateways ); + $gateways + ); } /** @@ -95,23 +103,29 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { $paypal = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => 'paypal', - 'title' => 'PayPal', - 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", - 'order' => '', - 'enabled' => false, - 'method_title' => 'PayPal', - 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', - 'method_supports' => array( - 'products', - 'refunds', + $this->assertEquals( + array( + 'id' => 'paypal', + 'title' => 'PayPal', + 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", + 'order' => '', + 'enabled' => false, + 'method_title' => 'PayPal', + 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', + 'method_supports' => array( + 'products', + 'refunds', + ), + 'settings' => array_diff_key( + $this->get_settings( 'WC_Gateway_Paypal' ), + array( + 'enabled' => false, + 'description' => false, + ) + ), ), - 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Paypal' ), array( - 'enabled' => false, - 'description' => false, - ) ), - ), $paypal ); + $paypal + ); } /** @@ -154,11 +168,13 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { // test updating single setting $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'email' => 'woo@woo.local', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'email' => 'woo@woo.local', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -169,12 +185,14 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { // test updating multiple settings $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'testmode' => 'yes', - 'title' => 'PayPal - New Title', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'testmode' => 'yes', + 'title' => 'PayPal - New Title', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -185,10 +203,12 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { // Test other parameters, and recheck settings $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'enabled' => false, - 'order' => 2, - ) ); + $request->set_body_params( + array( + 'enabled' => false, + 'order' => 2, + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -200,20 +220,24 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { // test bogus $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'paymentaction' => 'afasfasf', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'paymentaction' => 'afasfasf', + ), + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'paymentaction' => 'authorization', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'paymentaction' => 'authorization', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); $this->assertEquals( 'authorization', $paypal['settings']['paymentaction']['value'] ); @@ -227,12 +251,14 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { public function test_update_payment_gateway_without_permission() { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'testmode' => 'yes', - 'title' => 'PayPal - New Title', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'testmode' => 'yes', + 'title' => 'PayPal - New Title', + ), + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -244,10 +270,12 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { */ public function test_update_payment_gateway_invalid_id() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/totally_fake_method' ); - $request->set_body_params( array( - 'enabled' => true, - ) ); + $request = new WP_REST_Request( 'POST', '/wc/v3/payment_gateways/totally_fake_method' ); + $request->set_body_params( + array( + 'enabled' => true, + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 404, $response->get_status() ); } @@ -260,9 +288,9 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { public function test_payment_gateway_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/payment_gateways' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/payment_gateways' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 9, count( $properties ) ); diff --git a/tests/unit-tests/api/product-reviews.php b/tests/unit-tests/api/product-reviews.php index b0c2ecbadd5..f34fd15626c 100644 --- a/tests/unit-tests/api/product-reviews.php +++ b/tests/unit-tests/api/product-reviews.php @@ -80,7 +80,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { ), ), ), - ), $product_reviews + ), + $product_reviews ); } @@ -134,7 +135,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { 'rating' => 0, 'verified' => false, 'reviewer_avatar_urls' => $data['reviewer_avatar_urls'], - ), $data + ), + $data ); } @@ -198,7 +200,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { 'rating' => 5, 'verified' => false, 'reviewer_avatar_urls' => $data['reviewer_avatar_urls'], - ), $data + ), + $data ); } diff --git a/tests/unit-tests/api/reports-coupons-totals.php b/tests/unit-tests/api/reports-coupons-totals.php index ce21a9bdc34..cc4e1ef2de0 100644 --- a/tests/unit-tests/api/reports-coupons-totals.php +++ b/tests/unit-tests/api/reports-coupons-totals.php @@ -52,7 +52,8 @@ class WC_Tests_API_Reports_Coupons_Totals extends WC_REST_Unit_Test_Case { FROM $wpdb->postmeta WHERE meta_key = 'discount_type' AND meta_value = %s - ", $slug + ", + $slug ) ); diff --git a/tests/unit-tests/api/settings.php b/tests/unit-tests/api/settings.php index ad51c2f7c9a..aa4f67cd02e 100644 --- a/tests/unit-tests/api/settings.php +++ b/tests/unit-tests/api/settings.php @@ -15,9 +15,11 @@ class Settings extends WC_REST_Unit_Test_Case { parent::setUp(); $this->endpoint = new WC_REST_Setting_Options_Controller(); WC_Helper_Settings::register(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -41,39 +43,45 @@ class Settings extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'test', - 'label' => 'Test extension', - 'parent_id' => '', - 'description' => 'My awesome test settings.', - 'sub_groups' => array( 'sub-test' ), - '_links' => array( - 'options' => array( - array( - 'href' => rest_url( '/wc/v3/settings/test' ), + $this->assertContains( + array( + 'id' => 'test', + 'label' => 'Test extension', + 'parent_id' => '', + 'description' => 'My awesome test settings.', + 'sub_groups' => array( 'sub-test' ), + '_links' => array( + 'options' => array( + array( + 'href' => rest_url( '/wc/v3/settings/test' ), + ), ), ), ), - ), $data ); + $data + ); - $this->assertContains( array( - 'id' => 'sub-test', - 'label' => 'Sub test', - 'parent_id' => 'test', - 'description' => '', - 'sub_groups' => array(), - '_links' => array( - 'options' => array( - array( - 'href' => rest_url( '/wc/v3/settings/sub-test' ), + $this->assertContains( + array( + 'id' => 'sub-test', + 'label' => 'Sub test', + 'parent_id' => 'test', + 'description' => '', + 'sub_groups' => array(), + '_links' => array( + 'options' => array( + array( + 'href' => rest_url( '/wc/v3/settings/sub-test' ), + ), ), ), ), - ), $data ); + $data + ); } /** @@ -111,9 +119,9 @@ class Settings extends WC_REST_Unit_Test_Case { * @since 3.5.0 */ public function test_get_group_schema() { - $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/settings' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/settings' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 5, count( $properties ) ); $this->assertArrayHasKey( 'id', $properties ); @@ -129,9 +137,9 @@ class Settings extends WC_REST_Unit_Test_Case { * @since 3.5.0 */ public function test_get_setting_schema() { - $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/settings/test/woocommerce_shop_page_display' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/settings/test/woocommerce_shop_page_display' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 10, count( $properties ) ); $this->assertArrayHasKey( 'id', $properties ); @@ -168,7 +176,7 @@ class Settings extends WC_REST_Unit_Test_Case { // test getting a valid group with settings attached to it $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/test' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 1, count( $data ) ); $this->assertEquals( 'woocommerce_shop_page_display', $data[0]['id'] ); $this->assertEmpty( $data[0]['value'] ); @@ -196,36 +204,42 @@ class Settings extends WC_REST_Unit_Test_Case { // test defaults first $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/test/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data['value'] ); // test updating shop display setting $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'both', - ) ); + $request->set_body_params( + array( + 'value' => 'both', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'both', $data['value'] ); $this->assertEquals( 'both', get_option( 'woocommerce_shop_page_display' ) ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'subcategories', - ) ); + $request->set_body_params( + array( + 'value' => 'subcategories', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'subcategories', $data['value'] ); $this->assertEquals( 'subcategories', get_option( 'woocommerce_shop_page_display' ) ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => '', - ) ); + $request->set_body_params( + array( + 'value' => '', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data['value'] ); $this->assertEquals( '', get_option( 'woocommerce_shop_page_display' ) ); @@ -241,37 +255,41 @@ class Settings extends WC_REST_Unit_Test_Case { // test defaults first $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/test' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data[0]['value'] ); // test setting both at once $request = new WP_REST_Request( 'POST', '/wc/v3/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'both', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'both', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'both', $data['update'][0]['value'] ); $this->assertEquals( 'both', get_option( 'woocommerce_shop_page_display' ) ); // test updating one, but making sure the other value stays the same $request = new WP_REST_Request( 'POST', '/wc/v3/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'subcategories', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'subcategories', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'subcategories', $data['update'][0]['value'] ); $this->assertEquals( 'subcategories', get_option( 'woocommerce_shop_page_display' ) ); } @@ -286,17 +304,17 @@ class Settings extends WC_REST_Unit_Test_Case { // test getting an invalid setting from a group that does not exist $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/not-real/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 404, $response->get_status() ); // test getting an invalid setting from a group that does exist $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/invalid/invalid' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 404, $response->get_status() ); // test getting a valid setting $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/test/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); @@ -374,9 +392,11 @@ class Settings extends WC_REST_Unit_Test_Case { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'subcategories', - ) ); + $request->set_body_params( + array( + 'value' => 'subcategories', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -391,14 +411,16 @@ class Settings extends WC_REST_Unit_Test_Case { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'POST', '/wc/v3/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'subcategories', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'subcategories', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -413,9 +435,11 @@ class Settings extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/test/invalid' ); - $request->set_body_params( array( - 'value' => 'test', - ) ); + $request->set_body_params( + array( + 'value' => 'test', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 404, $response->get_status() ); } @@ -430,43 +454,48 @@ class Settings extends WC_REST_Unit_Test_Case { // Make sure the group is properly registered $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/products' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertTrue( is_array( $data ) ); - $this->assertContains( array( - 'id' => 'woocommerce_downloads_require_login', - 'label' => 'Access restriction', - 'description' => 'Downloads require login', - 'type' => 'checkbox', - 'default' => 'no', - 'tip' => 'This setting does not apply to guest purchases.', - 'value' => 'no', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v3/settings/products/woocommerce_downloads_require_login' ), + $this->assertContains( + array( + 'id' => 'woocommerce_downloads_require_login', + 'label' => 'Access restriction', + 'description' => 'Downloads require login', + 'type' => 'checkbox', + 'default' => 'no', + 'tip' => 'This setting does not apply to guest purchases.', + 'value' => 'no', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v3/settings/products/woocommerce_downloads_require_login' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v3/settings/products' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v3/settings/products' ), + ), ), ), ), - ), $data ); + $data + ); // test get single $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/products/woocommerce_dimension_unit' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'cm', $data['default'] ); // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'products', 'woocommerce_dimension_unit' ) ); - $request->set_body_params( array( - 'value' => 'yd', - ) ); + $request->set_body_params( + array( + 'value' => 'yd', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'yd', $data['value'] ); $this->assertEquals( 'yd', get_option( 'woocommerce_dimension_unit' ) ); @@ -485,64 +514,75 @@ class Settings extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'recipient', - 'label' => 'Recipient(s)', - 'description' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', - 'type' => 'text', - 'default' => '', - 'tip' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', - 'value' => '', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v3/settings/email_new_order/recipient' ), + $this->assertContains( + array( + 'id' => 'recipient', + 'label' => 'Recipient(s)', + 'description' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', + 'type' => 'text', + 'default' => '', + 'tip' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', + 'value' => '', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v3/settings/email_new_order/recipient' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v3/settings/email_new_order' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v3/settings/email_new_order' ), + ), ), ), ), - ), $settings ); + $settings + ); // test get single $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/settings/email_new_order/subject' ) ); $setting = $response->get_data(); - $this->assertEquals( array( - 'id' => 'subject', - 'label' => 'Subject', - 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'type' => 'text', - 'default' => '', - 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'value' => '', - 'group_id' => 'email_new_order', - ), $setting ); + $this->assertEquals( + array( + 'id' => 'subject', + 'label' => 'Subject', + 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'type' => 'text', + 'default' => '', + 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'value' => '', + 'group_id' => 'email_new_order', + ), + $setting + ); // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'email_new_order', 'subject' ) ); - $request->set_body_params( array( - 'value' => 'This is my subject', - ) ); + $request->set_body_params( + array( + 'value' => 'This is my subject', + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); - $this->assertEquals( array( - 'id' => 'subject', - 'label' => 'Subject', - 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'type' => 'text', - 'default' => '', - 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'value' => 'This is my subject', - 'group_id' => 'email_new_order', - ), $setting ); + $this->assertEquals( + array( + 'id' => 'subject', + 'label' => 'Subject', + 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'type' => 'text', + 'default' => '', + 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'value' => 'This is my subject', + 'group_id' => 'email_new_order', + ), + $setting + ); // test updating another subject and making sure it works with a "similar" id - $request = new WP_REST_Request( 'GET', sprintf( '/wc/v3/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); + $request = new WP_REST_Request( 'GET', sprintf( '/wc/v3/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); @@ -550,9 +590,11 @@ class Settings extends WC_REST_Unit_Test_Case { // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); - $request->set_body_params( array( - 'value' => 'This is my new subject', - ) ); + $request->set_body_params( + array( + 'value' => 'This is my new subject', + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); @@ -575,25 +617,31 @@ class Settings extends WC_REST_Unit_Test_Case { // test bogus value $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'not_yes_or_no', - ) ); + $request->set_body_params( + array( + 'value' => 'not_yes_or_no', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // test yes $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'yes', - ) ); + $request->set_body_params( + array( + 'value' => 'yes', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); // test no $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'no', - ) ); + $request->set_body_params( + array( + 'value' => 'no', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); } @@ -608,17 +656,21 @@ class Settings extends WC_REST_Unit_Test_Case { // not a valid option $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'shipping', 'woocommerce_ship_to_destination' ) ); - $request->set_body_params( array( - 'value' => 'billing2', - ) ); + $request->set_body_params( + array( + 'value' => 'billing2', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // valid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'shipping', 'woocommerce_ship_to_destination' ) ); - $request->set_body_params( array( - 'value' => 'billing', - ) ); + $request->set_body_params( + array( + 'value' => 'billing', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); } @@ -636,9 +688,11 @@ class Settings extends WC_REST_Unit_Test_Case { $this->assertEmpty( $setting['value'] ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'general', 'woocommerce_specific_allowed_countries' ) ); - $request->set_body_params( array( - 'value' => array( 'AX', 'DZ', 'MMM' ), - ) ); + $request->set_body_params( + array( + 'value' => array( 'AX', 'DZ', 'MMM' ), + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( array( 'AX', 'DZ' ), $setting['value'] ); @@ -658,17 +712,21 @@ class Settings extends WC_REST_Unit_Test_Case { // invalid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'products', 'woocommerce_weight_unit' ) ); - $request->set_body_params( array( - 'value' => 'pounds', // invalid, should be lbs - ) ); + $request->set_body_params( + array( + 'value' => 'pounds', // invalid, should be lbs + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // valid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v3/settings/%s/%s', 'products', 'woocommerce_weight_unit' ) ); - $request->set_body_params( array( - 'value' => 'lbs', // invalid, should be lbs - ) ); + $request->set_body_params( + array( + 'value' => 'lbs', // invalid, should be lbs + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( 'lbs', $setting['value'] ); @@ -705,19 +763,23 @@ class Settings extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -737,19 +799,23 @@ class Settings extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address_2' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address_2' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_address_2' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -769,19 +835,23 @@ class Settings extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_city' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_city' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_city' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -801,19 +871,23 @@ class Settings extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_postcode' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_postcode' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v3/settings/general/woocommerce_store_postcode' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); diff --git a/tests/unit-tests/api/shipping-methods.php b/tests/unit-tests/api/shipping-methods.php index e329603c84c..ad139c427af 100644 --- a/tests/unit-tests/api/shipping-methods.php +++ b/tests/unit-tests/api/shipping-methods.php @@ -14,9 +14,11 @@ class Shipping_Methods extends WC_REST_Unit_Test_Case { public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Methods_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -39,26 +41,29 @@ class Shipping_Methods extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/shipping_methods' ) ); - $methods = $response->get_data(); + $methods = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'free_shipping', - 'title' => 'Free shipping', - 'description' => 'Free shipping is a special method which can be triggered with coupons and minimum spends.', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v3/shipping_methods/free_shipping' ), + $this->assertContains( + array( + 'id' => 'free_shipping', + 'title' => 'Free shipping', + 'description' => 'Free shipping is a special method which can be triggered with coupons and minimum spends.', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v3/shipping_methods/free_shipping' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v3/shipping_methods' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v3/shipping_methods' ), + ), ), ), ), - ), $methods ); + $methods + ); } /** @@ -84,11 +89,14 @@ class Shipping_Methods extends WC_REST_Unit_Test_Case { $method = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => 'local_pickup', - 'title' => 'Local pickup', - 'description' => 'Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.', - ), $method ); + $this->assertEquals( + array( + 'id' => 'local_pickup', + 'title' => 'Local pickup', + 'description' => 'Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.', + ), + $method + ); } /** @@ -122,9 +130,9 @@ class Shipping_Methods extends WC_REST_Unit_Test_Case { public function test_shipping_method_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/shipping_methods' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v3/shipping_methods' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 3, count( $properties ) ); diff --git a/tests/unit-tests/api/shipping-zones.php b/tests/unit-tests/api/shipping-zones.php index bf468060b1e..580391d1b33 100644 --- a/tests/unit-tests/api/shipping-zones.php +++ b/tests/unit-tests/api/shipping-zones.php @@ -99,7 +99,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); // Create a zone and make sure it's in the response @@ -132,7 +133,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -222,7 +224,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -288,7 +291,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -391,7 +395,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -418,7 +423,9 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { // Create a zone $zone = $this->create_shipping_zone( - 'Zone 1', 0, array( + 'Zone 1', + 0, + array( array( 'code' => 'US', 'type' => 'country', @@ -449,7 +456,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -552,7 +560,8 @@ class WC_Tests_API_Shipping_Zones extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } diff --git a/tests/unit-tests/api/v2/coupons.php b/tests/unit-tests/api/v2/coupons.php index fceda0fe741..592357327f7 100644 --- a/tests/unit-tests/api/v2/coupons.php +++ b/tests/unit-tests/api/v2/coupons.php @@ -12,12 +12,14 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { * Setup test coupon data. * @since 3.0.0 */ - public function setUp() { + public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Coupons_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -43,51 +45,54 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/coupons' ) ); - $coupons = $response->get_data(); + $coupons = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $coupons ) ); - $this->assertContains( array( - 'id' => $coupon_1->get_id(), - 'code' => 'dummycoupon-1', - 'amount' => '1.00', - 'date_created' => wc_rest_prepare_date_response( $post_1->post_date_gmt, false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $post_1->post_date_gmt ), - 'date_modified' => wc_rest_prepare_date_response( $post_1->post_modified_gmt, false ), - 'date_modified_gmt' => wc_rest_prepare_date_response( $post_1->post_modified_gmt ), - 'discount_type' => 'fixed_cart', - 'description' => 'This is a dummy coupon', - 'date_expires' => '', - 'date_expires_gmt' => '', - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => '', - 'usage_limit_per_user' => '', - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v2/coupons/' . $coupon_1->get_id() ), + $this->assertContains( + array( + 'id' => $coupon_1->get_id(), + 'code' => 'dummycoupon-1', + 'amount' => '1.00', + 'date_created' => wc_rest_prepare_date_response( $post_1->post_date_gmt, false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $post_1->post_date_gmt ), + 'date_modified' => wc_rest_prepare_date_response( $post_1->post_modified_gmt, false ), + 'date_modified_gmt' => wc_rest_prepare_date_response( $post_1->post_modified_gmt ), + 'discount_type' => 'fixed_cart', + 'description' => 'This is a dummy coupon', + 'date_expires' => '', + 'date_expires_gmt' => '', + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => '', + 'usage_limit_per_user' => '', + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/coupons/' . $coupon_1->get_id() ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/coupons' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/coupons' ), + ), ), ), ), - ), $coupons ); + $coupons + ); } /** @@ -112,35 +117,38 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => $coupon->get_id(), - 'code' => 'dummycoupon-1', - 'amount' => '1.00', - 'date_created' => wc_rest_prepare_date_response( $post->post_date_gmt, false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $post->post_date_gmt ), - 'date_modified' => wc_rest_prepare_date_response( $post->post_modified_gmt, false ), - 'date_modified_gmt' => wc_rest_prepare_date_response( $post->post_modified_gmt ), - 'discount_type' => 'fixed_cart', - 'description' => 'This is a dummy coupon', - 'date_expires' => null, - 'date_expires_gmt' => null, - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => null, - 'usage_limit_per_user' => null, - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - ), $data ); + $this->assertEquals( + array( + 'id' => $coupon->get_id(), + 'code' => 'dummycoupon-1', + 'amount' => '1.00', + 'date_created' => wc_rest_prepare_date_response( $post->post_date_gmt, false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $post->post_date_gmt ), + 'date_modified' => wc_rest_prepare_date_response( $post->post_modified_gmt, false ), + 'date_modified_gmt' => wc_rest_prepare_date_response( $post->post_modified_gmt ), + 'discount_type' => 'fixed_cart', + 'description' => 'This is a dummy coupon', + 'date_expires' => null, + 'date_expires_gmt' => null, + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => null, + 'usage_limit_per_user' => null, + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + ), + $data + ); } /** @@ -171,46 +179,51 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { public function test_create_coupon() { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'POST', '/wc/v2/coupons' ); - $request->set_body_params( array( - 'code' => 'test', - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - 'description' => 'Test', - 'usage_limit' => 10, - ) ); + $request->set_body_params( + array( + 'code' => 'test', + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + 'description' => 'Test', + 'usage_limit' => 10, + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 201, $response->get_status() ); - $this->assertEquals( array( - 'id' => $data['id'], - 'code' => 'test', - 'amount' => '5.00', - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'discount_type' => 'fixed_product', - 'description' => 'Test', - 'date_expires' => null, - 'date_expires_gmt' => null, - 'usage_count' => 0, - 'individual_use' => false, - 'product_ids' => array(), - 'excluded_product_ids' => array(), - 'usage_limit' => 10, - 'usage_limit_per_user' => null, - 'limit_usage_to_x_items' => null, - 'free_shipping' => false, - 'product_categories' => array(), - 'excluded_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '0.00', - 'maximum_amount' => '0.00', - 'email_restrictions' => array(), - 'used_by' => array(), - 'meta_data' => array(), - ), $data ); + $this->assertEquals( + array( + 'id' => $data['id'], + 'code' => 'test', + 'amount' => '5.00', + 'date_created' => $data['date_created'], + 'date_created_gmt' => $data['date_created_gmt'], + 'date_modified' => $data['date_modified'], + 'date_modified_gmt' => $data['date_modified_gmt'], + 'discount_type' => 'fixed_product', + 'description' => 'Test', + 'date_expires' => null, + 'date_expires_gmt' => null, + 'usage_count' => 0, + 'individual_use' => false, + 'product_ids' => array(), + 'excluded_product_ids' => array(), + 'usage_limit' => 10, + 'usage_limit_per_user' => null, + 'limit_usage_to_x_items' => null, + 'free_shipping' => false, + 'product_categories' => array(), + 'excluded_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '0.00', + 'maximum_amount' => '0.00', + 'email_restrictions' => array(), + 'used_by' => array(), + 'meta_data' => array(), + ), + $data + ); } /** @@ -222,12 +235,14 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { // test no code... $request = new WP_REST_Request( 'POST', '/wc/v2/coupons' ); - $request->set_body_params( array( - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - ) ); + $request->set_body_params( + array( + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 400, $response->get_status() ); } @@ -241,13 +256,15 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { // test no code... $request = new WP_REST_Request( 'POST', '/wc/v2/coupons' ); - $request->set_body_params( array( - 'code' => 'fail', - 'amount' => '5.00', - 'discount_type' => 'fixed_product', - ) ); + $request->set_body_params( + array( + 'code' => 'fail', + 'amount' => '5.00', + 'discount_type' => 'fixed_product', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 401, $response->get_status() ); } @@ -258,8 +275,8 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { */ public function test_update_coupon() { wp_set_current_user( $this->user ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $post = get_post( $coupon->get_id() ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $post = get_post( $coupon->get_id() ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/coupons/' . $coupon->get_id() ) ); $data = $response->get_data(); @@ -268,12 +285,14 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( '1.00', $data['amount'] ); $request = new WP_REST_Request( 'PUT', '/wc/v2/coupons/' . $coupon->get_id() ); - $request->set_body_params( array( - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '10.00', $data['amount'] ); $this->assertEquals( 'New description', $data['description'] ); @@ -288,13 +307,15 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'PUT', '/wc/v2/coupons/0' ); - $request->set_body_params( array( - 'code' => 'tester', - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'code' => 'tester', + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 400, $response->get_status() ); } @@ -305,14 +326,16 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { */ public function test_update_coupon_without_permission() { wp_set_current_user( 0 ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $post = get_post( $coupon->get_id() ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $post = get_post( $coupon->get_id() ); $request = new WP_REST_Request( 'PUT', '/wc/v2/coupons/' . $coupon->get_id() ); - $request->set_body_params( array( - 'amount' => '10.00', - 'description' => 'New description', - ) ); + $request->set_body_params( + array( + 'amount' => '10.00', + 'description' => 'New description', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); @@ -324,7 +347,7 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { */ public function test_delete_coupon() { wp_set_current_user( $this->user ); - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); $request = new WP_REST_Request( 'DELETE', '/wc/v2/coupons/' . $coupon->get_id() ); $request->set_param( 'force', true ); $response = $this->server->dispatch( $request ); @@ -364,32 +387,34 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { public function test_batch_coupon() { wp_set_current_user( $this->user ); - $coupon_1 = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); - $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); - $coupon_3 = WC_Helper_Coupon::create_coupon( 'dummycoupon-3' ); - $coupon_4 = WC_Helper_Coupon::create_coupon( 'dummycoupon-4' ); + $coupon_1 = WC_Helper_Coupon::create_coupon( 'dummycoupon-1' ); + $coupon_2 = WC_Helper_Coupon::create_coupon( 'dummycoupon-2' ); + $coupon_3 = WC_Helper_Coupon::create_coupon( 'dummycoupon-3' ); + $coupon_4 = WC_Helper_Coupon::create_coupon( 'dummycoupon-4' ); $request = new WP_REST_Request( 'POST', '/wc/v2/coupons/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => $coupon_1->get_id(), - 'amount' => '5.15', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => $coupon_1->get_id(), + 'amount' => '5.15', + ), ), - ), - 'delete' => array( - $coupon_2->get_id(), - $coupon_3->get_id(), - ), - 'create' => array( - array( - 'code' => 'new-coupon', - 'amount' => '11.00', + 'delete' => array( + $coupon_2->get_id(), + $coupon_3->get_id(), ), - ), - ) ); + 'create' => array( + array( + 'code' => 'new-coupon', + 'amount' => '11.00', + ), + ), + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '5.15', $data['update'][0]['amount'] ); $this->assertEquals( '11.00', $data['create'][0]['amount'] ); @@ -397,9 +422,9 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( $coupon_2->get_id(), $data['delete'][0]['id'] ); $this->assertEquals( $coupon_3->get_id(), $data['delete'][1]['id'] ); - $request = new WP_REST_Request( 'GET', '/wc/v2/coupons' ); + $request = new WP_REST_Request( 'GET', '/wc/v2/coupons' ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 3, count( $data ) ); } @@ -410,9 +435,9 @@ class WC_Tests_API_Coupons_V2 extends WC_REST_Unit_Test_Case { */ public function test_coupon_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/coupons' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/coupons' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 27, count( $properties ) ); diff --git a/tests/unit-tests/api/v2/customers.php b/tests/unit-tests/api/v2/customers.php index e2346d41876..d6519cd246c 100644 --- a/tests/unit-tests/api/v2/customers.php +++ b/tests/unit-tests/api/v2/customers.php @@ -41,68 +41,73 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { WC_Helper_Customer::create_customer( 'test2', 'test2', 'test2@woo.local' ); $request = new WP_REST_Request( 'GET', '/wc/v2/customers' ); - $request->set_query_params( array( - 'orderby' => 'id', - ) ); + $request->set_query_params( + array( + 'orderby' => 'id', + ) + ); $response = $this->server->dispatch( $request ); $customers = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $customers ) ); - $this->assertContains( array( - 'id' => $customer_1->get_id(), - 'date_created' => wc_rest_prepare_date_response( $customer_1->get_date_created(), false ), - 'date_created_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_created() ), - 'date_modified' => wc_rest_prepare_date_response( $customer_1->get_date_modified(), false ), - 'date_modified_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_modified() ), - 'email' => 'test@woo.local', - 'first_name' => 'Justin', - 'last_name' => '', - 'role' => 'customer', - 'username' => 'testcustomer', - 'billing' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '123 South Street', - 'address_2' => 'Apt 1', - 'city' => 'Philadelphia', - 'state' => 'PA', - 'postcode' => '19123', - 'country' => 'US', - 'email' => '', - 'phone' => '', - ), - 'shipping' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '123 South Street', - 'address_2' => 'Apt 1', - 'city' => 'Philadelphia', - 'state' => 'PA', - 'postcode' => '19123', - 'country' => 'US', - ), - 'is_paying_customer' => false, - 'orders_count' => 0, - 'total_spent' => '0.00', - 'avatar_url' => $customer_1->get_avatar_url(), - 'meta_data' => array(), - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v2/customers/' . $customer_1->get_id() . '' ), - ), + $this->assertContains( + array( + 'id' => $customer_1->get_id(), + 'date_created' => wc_rest_prepare_date_response( $customer_1->get_date_created(), false ), + 'date_created_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_created() ), + 'date_modified' => wc_rest_prepare_date_response( $customer_1->get_date_modified(), false ), + 'date_modified_gmt' => wc_rest_prepare_date_response( $customer_1->get_date_modified() ), + 'email' => 'test@woo.local', + 'first_name' => 'Justin', + 'last_name' => '', + 'role' => 'customer', + 'username' => 'testcustomer', + 'billing' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '123 South Street', + 'address_2' => 'Apt 1', + 'city' => 'Philadelphia', + 'state' => 'PA', + 'postcode' => '19123', + 'country' => 'US', + 'email' => '', + 'phone' => '', ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/customers' ), + 'shipping' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '123 South Street', + 'address_2' => 'Apt 1', + 'city' => 'Philadelphia', + 'state' => 'PA', + 'postcode' => '19123', + 'country' => 'US', + ), + 'is_paying_customer' => false, + 'orders_count' => 0, + 'total_spent' => '0.00', + 'avatar_url' => $customer_1->get_avatar_url(), + 'meta_data' => array(), + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/customers/' . $customer_1->get_id() . '' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/customers' ), + ), ), ), ), - ), $customers ); + $customers + ); } /** @@ -126,129 +131,141 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { // Test just the basics first.. $request = new WP_REST_Request( 'POST', '/wc/v2/customers' ); - $request->set_body_params( array( - 'username' => 'create_customer_test', - 'password' => 'test123', - 'email' => 'create_customer_test@woo.local', - ) ); + $request->set_body_params( + array( + 'username' => 'create_customer_test', + 'password' => 'test123', + 'email' => 'create_customer_test@woo.local', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 201, $response->get_status() ); - $this->assertEquals( array( - 'id' => $data['id'], - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'email' => 'create_customer_test@woo.local', - 'first_name' => '', - 'last_name' => '', - 'role' => 'customer', - 'username' => 'create_customer_test', - 'billing' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '', - 'address_2' => '', - 'city' => '', - 'state' => '', - 'postcode' => '', - 'country' => '', - 'email' => '', - 'phone' => '', + $this->assertEquals( + array( + 'id' => $data['id'], + 'date_created' => $data['date_created'], + 'date_created_gmt' => $data['date_created_gmt'], + 'date_modified' => $data['date_modified'], + 'date_modified_gmt' => $data['date_modified_gmt'], + 'email' => 'create_customer_test@woo.local', + 'first_name' => '', + 'last_name' => '', + 'role' => 'customer', + 'username' => 'create_customer_test', + 'billing' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => '', + 'postcode' => '', + 'country' => '', + 'email' => '', + 'phone' => '', + ), + 'shipping' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => '', + 'postcode' => '', + 'country' => '', + ), + 'is_paying_customer' => false, + 'meta_data' => array(), + 'orders_count' => 0, + 'total_spent' => '0.00', + 'avatar_url' => $data['avatar_url'], ), - 'shipping' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '', - 'address_2' => '', - 'city' => '', - 'state' => '', - 'postcode' => '', - 'country' => '', - ), - 'is_paying_customer' => false, - 'meta_data' => array(), - 'orders_count' => 0, - 'total_spent' => '0.00', - 'avatar_url' => $data['avatar_url'], - ), $data ); + $data + ); // Test extra data $request = new WP_REST_Request( 'POST', '/wc/v2/customers' ); - $request->set_body_params( array( - 'username' => 'create_customer_test2', - 'password' => 'test123', - 'email' => 'create_customer_test2@woo.local', - 'first_name' => 'Test', - 'last_name' => 'McTestFace', - 'billing' => array( - 'country' => 'US', - 'state' => 'WA', - ), - 'shipping' => array( - 'state' => 'CA', - 'country' => 'US', - ), - ) ); + $request->set_body_params( + array( + 'username' => 'create_customer_test2', + 'password' => 'test123', + 'email' => 'create_customer_test2@woo.local', + 'first_name' => 'Test', + 'last_name' => 'McTestFace', + 'billing' => array( + 'country' => 'US', + 'state' => 'WA', + ), + 'shipping' => array( + 'state' => 'CA', + 'country' => 'US', + ), + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 201, $response->get_status() ); - $this->assertEquals( array( - 'id' => $data['id'], - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'email' => 'create_customer_test2@woo.local', - 'first_name' => 'Test', - 'last_name' => 'McTestFace', - 'role' => 'customer', - 'username' => 'create_customer_test2', - 'billing' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '', - 'address_2' => '', - 'city' => '', - 'state' => 'WA', - 'postcode' => '', - 'country' => 'US', - 'email' => '', - 'phone' => '', + $this->assertEquals( + array( + 'id' => $data['id'], + 'date_created' => $data['date_created'], + 'date_created_gmt' => $data['date_created_gmt'], + 'date_modified' => $data['date_modified'], + 'date_modified_gmt' => $data['date_modified_gmt'], + 'email' => 'create_customer_test2@woo.local', + 'first_name' => 'Test', + 'last_name' => 'McTestFace', + 'role' => 'customer', + 'username' => 'create_customer_test2', + 'billing' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => 'WA', + 'postcode' => '', + 'country' => 'US', + 'email' => '', + 'phone' => '', + ), + 'shipping' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => 'CA', + 'postcode' => '', + 'country' => 'US', + ), + 'is_paying_customer' => false, + 'meta_data' => array(), + 'orders_count' => 0, + 'total_spent' => '0.00', + 'avatar_url' => $data['avatar_url'], ), - 'shipping' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '', - 'address_2' => '', - 'city' => '', - 'state' => 'CA', - 'postcode' => '', - 'country' => 'US', - ), - 'is_paying_customer' => false, - 'meta_data' => array(), - 'orders_count' => 0, - 'total_spent' => '0.00', - 'avatar_url' => $data['avatar_url'], - ), $data ); + $data + ); // Test without required field $request = new WP_REST_Request( 'POST', '/wc/v2/customers' ); - $request->set_body_params( array( - 'username' => 'create_customer_test3', - 'first_name' => 'Test', - 'last_name' => 'McTestFace', - ) ); + $request->set_body_params( + array( + 'username' => 'create_customer_test3', + 'first_name' => 'Test', + 'last_name' => 'McTestFace', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 400, $response->get_status() ); } @@ -261,11 +278,13 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { public function test_create_customer_without_permission() { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'POST', '/wc/v2/customers' ); - $request->set_body_params( array( - 'username' => 'create_customer_test_without_permission', - 'password' => 'test123', - 'email' => 'create_customer_test_without_permission@woo.local', - ) ); + $request->set_body_params( + array( + 'username' => 'create_customer_test_without_permission', + 'password' => 'test123', + 'email' => 'create_customer_test_without_permission@woo.local', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -279,49 +298,52 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( 1 ); $customer = WC_Helper_Customer::create_customer( 'get_customer_test', 'test123', 'get_customer_test@woo.local' ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/customers/' . $customer->get_id() ) ); - $data = $response->get_data(); + $data = $response->get_data(); - $this->assertEquals( array( - 'id' => $data['id'], - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'email' => 'get_customer_test@woo.local', - 'first_name' => 'Justin', - 'billing' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '123 South Street', - 'address_2' => 'Apt 1', - 'city' => 'Philadelphia', - 'state' => 'PA', - 'postcode' => '19123', - 'country' => 'US', - 'email' => '', - 'phone' => '', + $this->assertEquals( + array( + 'id' => $data['id'], + 'date_created' => $data['date_created'], + 'date_created_gmt' => $data['date_created_gmt'], + 'date_modified' => $data['date_modified'], + 'date_modified_gmt' => $data['date_modified_gmt'], + 'email' => 'get_customer_test@woo.local', + 'first_name' => 'Justin', + 'billing' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '123 South Street', + 'address_2' => 'Apt 1', + 'city' => 'Philadelphia', + 'state' => 'PA', + 'postcode' => '19123', + 'country' => 'US', + 'email' => '', + 'phone' => '', + ), + 'shipping' => array( + 'first_name' => '', + 'last_name' => '', + 'company' => '', + 'address_1' => '123 South Street', + 'address_2' => 'Apt 1', + 'city' => 'Philadelphia', + 'state' => 'PA', + 'postcode' => '19123', + 'country' => 'US', + ), + 'is_paying_customer' => false, + 'meta_data' => array(), + 'last_name' => '', + 'role' => 'customer', + 'username' => 'get_customer_test', + 'orders_count' => 0, + 'total_spent' => '0.00', + 'avatar_url' => $data['avatar_url'], ), - 'shipping' => array( - 'first_name' => '', - 'last_name' => '', - 'company' => '', - 'address_1' => '123 South Street', - 'address_2' => 'Apt 1', - 'city' => 'Philadelphia', - 'state' => 'PA', - 'postcode' => '19123', - 'country' => 'US', - ), - 'is_paying_customer' => false, - 'meta_data' => array(), - 'last_name' => '', - 'role' => 'customer', - 'username' => 'get_customer_test', - 'orders_count' => 0, - 'total_spent' => '0.00', - 'avatar_url' => $data['avatar_url'], - ), $data ); + $data + ); } /** @@ -362,10 +384,12 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( 'update_customer_test@woo.local', $data['email'] ); $request = new WP_REST_Request( 'PUT', '/wc/v2/customers/' . $customer->get_id() ); - $request->set_body_params( array( - 'email' => 'updated_email@woo.local', - 'first_name' => 'UpdatedTest', - ) ); + $request->set_body_params( + array( + 'email' => 'updated_email@woo.local', + 'first_name' => 'UpdatedTest', + ) + ); $response = $this->server->dispatch( $request ); $data = $response->get_data(); @@ -418,7 +442,7 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { */ public function test_delete_customer_invalid_id() { wp_set_current_user( 1 ); - $request = new WP_REST_Request( 'DELETE', '/wc/v2/customers/0' ); + $request = new WP_REST_Request( 'DELETE', '/wc/v2/customers/0' ); $request->set_param( 'force', true ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); @@ -452,27 +476,29 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { $customer_4 = WC_Helper_Customer::create_customer( 'test_batch_customer4', 'test123', 'test_batch_customer4@woo.local' ); $request = new WP_REST_Request( 'POST', '/wc/v2/customers/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => $customer_1->get_id(), - 'last_name' => 'McTest', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => $customer_1->get_id(), + 'last_name' => 'McTest', + ), ), - ), - 'delete' => array( - $customer_2->get_id(), - $customer_3->get_id(), - ), - 'create' => array( - array( - 'username' => 'newuser', - 'password' => 'test123', - 'email' => 'newuser@woo.local', + 'delete' => array( + $customer_2->get_id(), + $customer_3->get_id(), ), - ), - ) ); + 'create' => array( + array( + 'username' => 'newuser', + 'password' => 'test123', + 'email' => 'newuser@woo.local', + ), + ), + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'McTest', $data['update'][0]['last_name'] ); $this->assertEquals( 'newuser', $data['create'][0]['username'] ); @@ -480,9 +506,9 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( $customer_2->get_id(), $data['delete'][0]['id'] ); $this->assertEquals( $customer_3->get_id(), $data['delete'][1]['id'] ); - $request = new WP_REST_Request( 'GET', '/wc/v2/customers' ); + $request = new WP_REST_Request( 'GET', '/wc/v2/customers' ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 3, count( $data ) ); } @@ -494,9 +520,9 @@ class Customers_V2 extends WC_REST_Unit_Test_Case { */ public function test_customer_schema() { wp_set_current_user( 1 ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/customers' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/customers' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 18, count( $properties ) ); diff --git a/tests/unit-tests/api/v2/orders.php b/tests/unit-tests/api/v2/orders.php index a431c0c309f..49df3ce98f7 100644 --- a/tests/unit-tests/api/v2/orders.php +++ b/tests/unit-tests/api/v2/orders.php @@ -120,10 +120,12 @@ class WC_Tests_API_Orders_V2 extends WC_REST_Unit_Test_Case { */ public function test_get_item_refund_id() { wp_set_current_user( $this->user ); - $order = WC_Helper_Order::create_order(); - $refund = wc_create_refund( array( - 'order_id' => $order->get_id(), - ) ); + $order = WC_Helper_Order::create_order(); + $refund = wc_create_refund( + array( + 'order_id' => $order->get_id(), + ) + ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/orders/' . $refund->get_id() ) ); $this->assertEquals( 404, $response->get_status() ); } @@ -273,7 +275,7 @@ class WC_Tests_API_Orders_V2 extends WC_REST_Unit_Test_Case { $request->set_body_params( array( 'payment_method' => 'bacs', - 'payment_method_title' => '

Sanitize this too

' + 'payment_method_title' => '

Sanitize this too

', ) ); $response = $this->server->dispatch( $request ); diff --git a/tests/unit-tests/api/v2/payment-gateways.php b/tests/unit-tests/api/v2/payment-gateways.php index fb3443dcff5..d8757c5d31d 100644 --- a/tests/unit-tests/api/v2/payment-gateways.php +++ b/tests/unit-tests/api/v2/payment-gateways.php @@ -14,9 +14,11 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Payment_Gateways_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -42,31 +44,37 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { $gateways = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'cheque', - 'title' => 'Check payments', - 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', - 'order' => '', - 'enabled' => false, - 'method_title' => 'Check payments', - 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', - 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Cheque' ), array( - 'enabled' => false, - 'description' => false, - ) ), - '_links' => array( - 'self' => array( + $this->assertContains( + array( + 'id' => 'cheque', + 'title' => 'Check payments', + 'description' => 'Please send a check to Store Name, Store Street, Store Town, Store State / County, Store Postcode.', + 'order' => '', + 'enabled' => false, + 'method_title' => 'Check payments', + 'method_description' => 'Take payments in person via checks. This offline gateway can also be useful to test purchases.', + 'settings' => array_diff_key( + $this->get_settings( 'WC_Gateway_Cheque' ), array( - 'href' => rest_url( '/wc/v2/payment_gateways/cheque' ), - ), + 'enabled' => false, + 'description' => false, + ) ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/payment_gateways' ), + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/payment_gateways/cheque' ), + ), + ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/payment_gateways' ), + ), ), ), ), - ), $gateways ); + $gateways + ); } /** @@ -92,19 +100,25 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { $paypal = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => 'paypal', - 'title' => 'PayPal', - 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", - 'order' => '', - 'enabled' => false, - 'method_title' => 'PayPal', - 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', - 'settings' => array_diff_key( $this->get_settings( 'WC_Gateway_Paypal' ), array( - 'enabled' => false, - 'description' => false, - ) ), - ), $paypal ); + $this->assertEquals( + array( + 'id' => 'paypal', + 'title' => 'PayPal', + 'description' => "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.", + 'order' => '', + 'enabled' => false, + 'method_title' => 'PayPal', + 'method_description' => 'PayPal Standard redirects customers to PayPal to enter their payment information.', + 'settings' => array_diff_key( + $this->get_settings( 'WC_Gateway_Paypal' ), + array( + 'enabled' => false, + 'description' => false, + ) + ), + ), + $paypal + ); } /** @@ -147,11 +161,13 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { // test updating single setting $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'email' => 'woo@woo.local', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'email' => 'woo@woo.local', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -162,12 +178,14 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { // test updating multiple settings $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'testmode' => 'yes', - 'title' => 'PayPal - New Title', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'testmode' => 'yes', + 'title' => 'PayPal - New Title', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -178,10 +196,12 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { // Test other parameters, and recheck settings $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'enabled' => false, - 'order' => 2, - ) ); + $request->set_body_params( + array( + 'enabled' => false, + 'order' => 2, + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); @@ -193,20 +213,24 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { // test bogus $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'paymentaction' => 'afasfasf', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'paymentaction' => 'afasfasf', + ), + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'paymentaction' => 'authorization', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'paymentaction' => 'authorization', + ), + ) + ); $response = $this->server->dispatch( $request ); $paypal = $response->get_data(); $this->assertEquals( 'authorization', $paypal['settings']['paymentaction']['value'] ); @@ -220,12 +244,14 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { public function test_update_payment_gateway_without_permission() { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/paypal' ); - $request->set_body_params( array( - 'settings' => array( - 'testmode' => 'yes', - 'title' => 'PayPal - New Title', - ), - ) ); + $request->set_body_params( + array( + 'settings' => array( + 'testmode' => 'yes', + 'title' => 'PayPal - New Title', + ), + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -237,10 +263,12 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { */ public function test_update_payment_gateway_invalid_id() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/totally_fake_method' ); - $request->set_body_params( array( - 'enabled' => true, - ) ); + $request = new WP_REST_Request( 'POST', '/wc/v2/payment_gateways/totally_fake_method' ); + $request->set_body_params( + array( + 'enabled' => true, + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 404, $response->get_status() ); } @@ -253,9 +281,9 @@ class Payment_Gateways_V2 extends WC_REST_Unit_Test_Case { public function test_payment_gateway_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/payment_gateways' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/payment_gateways' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 8, count( $properties ) ); diff --git a/tests/unit-tests/api/v2/product-reviews.php b/tests/unit-tests/api/v2/product-reviews.php index 5237ba8b0fb..bf30b5a41f2 100644 --- a/tests/unit-tests/api/v2/product-reviews.php +++ b/tests/unit-tests/api/v2/product-reviews.php @@ -80,7 +80,8 @@ class WC_Tests_API_Product_Reviews_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $product_reviews + ), + $product_reviews ); } @@ -134,7 +135,8 @@ class WC_Tests_API_Product_Reviews_V2 extends WC_REST_Unit_Test_Case { 'rating' => 0, 'verified' => false, 'reviewer_avatar_urls' => $data['reviewer_avatar_urls'], - ), $data + ), + $data ); } @@ -198,7 +200,8 @@ class WC_Tests_API_Product_Reviews_V2 extends WC_REST_Unit_Test_Case { 'rating' => 5, 'verified' => false, 'reviewer_avatar_urls' => $data['reviewer_avatar_urls'], - ), $data + ), + $data ); } diff --git a/tests/unit-tests/api/v2/settings.php b/tests/unit-tests/api/v2/settings.php index 91d5fc32c77..f88abaa1588 100644 --- a/tests/unit-tests/api/v2/settings.php +++ b/tests/unit-tests/api/v2/settings.php @@ -15,9 +15,11 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { parent::setUp(); $this->endpoint = new WC_REST_Setting_Options_Controller(); WC_Helper_Settings::register(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -41,39 +43,45 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'test', - 'label' => 'Test extension', - 'parent_id' => '', - 'description' => 'My awesome test settings.', - 'sub_groups' => array( 'sub-test' ), - '_links' => array( - 'options' => array( - array( - 'href' => rest_url( '/wc/v2/settings/test' ), + $this->assertContains( + array( + 'id' => 'test', + 'label' => 'Test extension', + 'parent_id' => '', + 'description' => 'My awesome test settings.', + 'sub_groups' => array( 'sub-test' ), + '_links' => array( + 'options' => array( + array( + 'href' => rest_url( '/wc/v2/settings/test' ), + ), ), ), ), - ), $data ); + $data + ); - $this->assertContains( array( - 'id' => 'sub-test', - 'label' => 'Sub test', - 'parent_id' => 'test', - 'description' => '', - 'sub_groups' => array(), - '_links' => array( - 'options' => array( - array( - 'href' => rest_url( '/wc/v2/settings/sub-test' ), + $this->assertContains( + array( + 'id' => 'sub-test', + 'label' => 'Sub test', + 'parent_id' => 'test', + 'description' => '', + 'sub_groups' => array(), + '_links' => array( + 'options' => array( + array( + 'href' => rest_url( '/wc/v2/settings/sub-test' ), + ), ), ), ), - ), $data ); + $data + ); } /** @@ -111,9 +119,9 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { * @since 3.0.0 */ public function test_get_group_schema() { - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/settings' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/settings' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 5, count( $properties ) ); $this->assertArrayHasKey( 'id', $properties ); @@ -129,9 +137,9 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { * @since 3.0.0 */ public function test_get_setting_schema() { - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/settings/test/woocommerce_shop_page_display' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/settings/test/woocommerce_shop_page_display' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 9, count( $properties ) ); $this->assertArrayHasKey( 'id', $properties ); @@ -167,7 +175,7 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test getting a valid group with settings attached to it $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/test' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 1, count( $data ) ); $this->assertEquals( 'woocommerce_shop_page_display', $data[0]['id'] ); $this->assertEmpty( $data[0]['value'] ); @@ -195,36 +203,42 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test defaults first $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/test/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data['value'] ); // test updating shop display setting $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'both', - ) ); + $request->set_body_params( + array( + 'value' => 'both', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'both', $data['value'] ); $this->assertEquals( 'both', get_option( 'woocommerce_shop_page_display' ) ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'subcategories', - ) ); + $request->set_body_params( + array( + 'value' => 'subcategories', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'subcategories', $data['value'] ); $this->assertEquals( 'subcategories', get_option( 'woocommerce_shop_page_display' ) ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => '', - ) ); + $request->set_body_params( + array( + 'value' => '', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data['value'] ); $this->assertEquals( '', get_option( 'woocommerce_shop_page_display' ) ); @@ -240,37 +254,41 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test defaults first $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/test' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( '', $data[0]['value'] ); // test setting both at once $request = new WP_REST_Request( 'POST', '/wc/v2/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'both', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'both', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'both', $data['update'][0]['value'] ); $this->assertEquals( 'both', get_option( 'woocommerce_shop_page_display' ) ); // test updating one, but making sure the other value stays the same $request = new WP_REST_Request( 'POST', '/wc/v2/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'subcategories', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'subcategories', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'subcategories', $data['update'][0]['value'] ); $this->assertEquals( 'subcategories', get_option( 'woocommerce_shop_page_display' ) ); } @@ -285,17 +303,17 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test getting an invalid setting from a group that does not exist $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/not-real/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 404, $response->get_status() ); // test getting an invalid setting from a group that does exist $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/invalid/invalid' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 404, $response->get_status() ); // test getting a valid setting $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/test/woocommerce_shop_page_display' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); @@ -373,9 +391,11 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'test', 'woocommerce_shop_page_display' ) ); - $request->set_body_params( array( - 'value' => 'subcategories', - ) ); + $request->set_body_params( + array( + 'value' => 'subcategories', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -390,14 +410,16 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( 0 ); $request = new WP_REST_Request( 'POST', '/wc/v2/settings/test/batch' ); - $request->set_body_params( array( - 'update' => array( - array( - 'id' => 'woocommerce_shop_page_display', - 'value' => 'subcategories', + $request->set_body_params( + array( + 'update' => array( + array( + 'id' => 'woocommerce_shop_page_display', + 'value' => 'subcategories', + ), ), - ), - ) ); + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 401, $response->get_status() ); } @@ -412,9 +434,11 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/test/invalid' ); - $request->set_body_params( array( - 'value' => 'test', - ) ); + $request->set_body_params( + array( + 'value' => 'test', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 404, $response->get_status() ); } @@ -429,43 +453,48 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // Make sure the group is properly registered $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/products' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertTrue( is_array( $data ) ); - $this->assertContains( array( - 'id' => 'woocommerce_downloads_require_login', - 'label' => 'Access restriction', - 'description' => 'Downloads require login', - 'type' => 'checkbox', - 'default' => 'no', - 'tip' => 'This setting does not apply to guest purchases.', - 'value' => 'no', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v2/settings/products/woocommerce_downloads_require_login' ), + $this->assertContains( + array( + 'id' => 'woocommerce_downloads_require_login', + 'label' => 'Access restriction', + 'description' => 'Downloads require login', + 'type' => 'checkbox', + 'default' => 'no', + 'tip' => 'This setting does not apply to guest purchases.', + 'value' => 'no', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/settings/products/woocommerce_downloads_require_login' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/settings/products' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/settings/products' ), + ), ), ), ), - ), $data ); + $data + ); // test get single $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/products/woocommerce_dimension_unit' ) ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'cm', $data['default'] ); // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'products', 'woocommerce_dimension_unit' ) ); - $request->set_body_params( array( - 'value' => 'yd', - ) ); + $request->set_body_params( + array( + 'value' => 'yd', + ) + ); $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $data = $response->get_data(); $this->assertEquals( 'yd', $data['value'] ); $this->assertEquals( 'yd', get_option( 'woocommerce_dimension_unit' ) ); @@ -484,62 +513,73 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'recipient', - 'label' => 'Recipient(s)', - 'description' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', - 'type' => 'text', - 'default' => '', - 'tip' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', - 'value' => '', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v2/settings/email_new_order/recipient' ), + $this->assertContains( + array( + 'id' => 'recipient', + 'label' => 'Recipient(s)', + 'description' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', + 'type' => 'text', + 'default' => '', + 'tip' => 'Enter recipients (comma separated) for this email. Defaults to admin@example.org.', + 'value' => '', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/settings/email_new_order/recipient' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/settings/email_new_order' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/settings/email_new_order' ), + ), ), ), ), - ), $settings ); + $settings + ); // test get single $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/settings/email_new_order/subject' ) ); $setting = $response->get_data(); - $this->assertEquals( array( - 'id' => 'subject', - 'label' => 'Subject', - 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'type' => 'text', - 'default' => '', - 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'value' => '', - ), $setting ); + $this->assertEquals( + array( + 'id' => 'subject', + 'label' => 'Subject', + 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'type' => 'text', + 'default' => '', + 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'value' => '', + ), + $setting + ); // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'email_new_order', 'subject' ) ); - $request->set_body_params( array( - 'value' => 'This is my subject', - ) ); + $request->set_body_params( + array( + 'value' => 'This is my subject', + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); - $this->assertEquals( array( - 'id' => 'subject', - 'label' => 'Subject', - 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'type' => 'text', - 'default' => '', - 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', - 'value' => 'This is my subject', - ), $setting ); + $this->assertEquals( + array( + 'id' => 'subject', + 'label' => 'Subject', + 'description' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'type' => 'text', + 'default' => '', + 'tip' => 'Available placeholders: {site_title}, {order_date}, {order_number}', + 'value' => 'This is my subject', + ), + $setting + ); // test updating another subject and making sure it works with a "similar" id - $request = new WP_REST_Request( 'GET', sprintf( '/wc/v2/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); + $request = new WP_REST_Request( 'GET', sprintf( '/wc/v2/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); @@ -547,9 +587,11 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test update $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'email_customer_new_account', 'subject' ) ); - $request->set_body_params( array( - 'value' => 'This is my new subject', - ) ); + $request->set_body_params( + array( + 'value' => 'This is my new subject', + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); @@ -572,25 +614,31 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // test bogus value $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'not_yes_or_no', - ) ); + $request->set_body_params( + array( + 'value' => 'not_yes_or_no', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // test yes $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'yes', - ) ); + $request->set_body_params( + array( + 'value' => 'yes', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); // test no $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'email_cancelled_order', 'enabled' ) ); - $request->set_body_params( array( - 'value' => 'no', - ) ); + $request->set_body_params( + array( + 'value' => 'no', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); } @@ -605,17 +653,21 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // not a valid option $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'shipping', 'woocommerce_ship_to_destination' ) ); - $request->set_body_params( array( - 'value' => 'billing2', - ) ); + $request->set_body_params( + array( + 'value' => 'billing2', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // valid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'shipping', 'woocommerce_ship_to_destination' ) ); - $request->set_body_params( array( - 'value' => 'billing', - ) ); + $request->set_body_params( + array( + 'value' => 'billing', + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); } @@ -633,9 +685,11 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { $this->assertEmpty( $setting['value'] ); $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'general', 'woocommerce_specific_allowed_countries' ) ); - $request->set_body_params( array( - 'value' => array( 'AX', 'DZ', 'MMM' ), - ) ); + $request->set_body_params( + array( + 'value' => array( 'AX', 'DZ', 'MMM' ), + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( array( 'AX', 'DZ' ), $setting['value'] ); @@ -655,17 +709,21 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // invalid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'products', 'woocommerce_weight_unit' ) ); - $request->set_body_params( array( - 'value' => 'pounds', // invalid, should be lbs - ) ); + $request->set_body_params( + array( + 'value' => 'pounds', // invalid, should be lbs + ) + ); $response = $this->server->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); // valid $request = new WP_REST_Request( 'PUT', sprintf( '/wc/v2/settings/%s/%s', 'products', 'woocommerce_weight_unit' ) ); - $request->set_body_params( array( - 'value' => 'lbs', // invalid, should be lbs - ) ); + $request->set_body_params( + array( + 'value' => 'lbs', // invalid, should be lbs + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( 'lbs', $setting['value'] ); @@ -702,19 +760,23 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -734,19 +796,23 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address_2' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address_2' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_address_2' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -766,19 +832,23 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_city' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_city' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_city' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); @@ -798,19 +868,23 @@ class Settings_V2 extends WC_REST_Unit_Test_Case { // Repalce the old value with something uniquely new $old_value = $setting['value']; $new_value = $old_value . ' ' . rand( 1000, 9999 ); - $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_postcode' ); - $request->set_body_params( array( - 'value' => $new_value, - ) ); + $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_postcode' ); + $request->set_body_params( + array( + 'value' => $new_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $new_value, $setting['value'] ); // Put the original value back $request = new WP_REST_Request( 'PUT', '/wc/v2/settings/general/woocommerce_store_postcode' ); - $request->set_body_params( array( - 'value' => $old_value, - ) ); + $request->set_body_params( + array( + 'value' => $old_value, + ) + ); $response = $this->server->dispatch( $request ); $setting = $response->get_data(); $this->assertEquals( $old_value, $setting['value'] ); diff --git a/tests/unit-tests/api/v2/shipping-methods.php b/tests/unit-tests/api/v2/shipping-methods.php index 95767ac954e..65c153e8f31 100644 --- a/tests/unit-tests/api/v2/shipping-methods.php +++ b/tests/unit-tests/api/v2/shipping-methods.php @@ -14,9 +14,11 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { public function setUp() { parent::setUp(); $this->endpoint = new WC_REST_Shipping_Methods_Controller(); - $this->user = $this->factory->user->create( array( - 'role' => 'administrator', - ) ); + $this->user = $this->factory->user->create( + array( + 'role' => 'administrator', + ) + ); } /** @@ -26,7 +28,7 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { */ public function test_register_routes() { $routes = $this->server->get_routes(); - $this->assertArrayHasKey( '/wc/v2/shipping_methods', $routes ); + $this->assertArrayHasKey( '/wc/v2/shipping_methods', $routes ); $this->assertArrayHasKey( '/wc/v2/shipping_methods/(?P[\w-]+)', $routes ); } @@ -39,26 +41,29 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { wp_set_current_user( $this->user ); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/shipping_methods' ) ); - $methods = $response->get_data(); + $methods = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertContains( array( - 'id' => 'free_shipping', - 'title' => 'Free shipping', - 'description' => 'Free shipping is a special method which can be triggered with coupons and minimum spends.', - '_links' => array( - 'self' => array( - array( - 'href' => rest_url( '/wc/v2/shipping_methods/free_shipping' ), + $this->assertContains( + array( + 'id' => 'free_shipping', + 'title' => 'Free shipping', + 'description' => 'Free shipping is a special method which can be triggered with coupons and minimum spends.', + '_links' => array( + 'self' => array( + array( + 'href' => rest_url( '/wc/v2/shipping_methods/free_shipping' ), + ), ), - ), - 'collection' => array( - array( - 'href' => rest_url( '/wc/v2/shipping_methods' ), + 'collection' => array( + array( + 'href' => rest_url( '/wc/v2/shipping_methods' ), + ), ), ), ), - ), $methods ); + $methods + ); } /** @@ -84,11 +89,14 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { $method = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( array( - 'id' => 'local_pickup', - 'title' => 'Local pickup', - 'description' => 'Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.', - ), $method ); + $this->assertEquals( + array( + 'id' => 'local_pickup', + 'title' => 'Local pickup', + 'description' => 'Allow customers to pick up orders themselves. By default, when using local pickup store base taxes will apply regardless of customer address.', + ), + $method + ); } /** @@ -122,9 +130,9 @@ class Shipping_Methods_V2 extends WC_REST_Unit_Test_Case { public function test_shipping_method_schema() { wp_set_current_user( $this->user ); - $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/shipping_methods' ); - $response = $this->server->dispatch( $request ); - $data = $response->get_data(); + $request = new WP_REST_Request( 'OPTIONS', '/wc/v2/shipping_methods' ); + $response = $this->server->dispatch( $request ); + $data = $response->get_data(); $properties = $data['schema']['properties']; $this->assertEquals( 3, count( $properties ) ); diff --git a/tests/unit-tests/api/v2/shipping-zones.php b/tests/unit-tests/api/v2/shipping-zones.php index 21cc9842e43..c6e2c4a102e 100644 --- a/tests/unit-tests/api/v2/shipping-zones.php +++ b/tests/unit-tests/api/v2/shipping-zones.php @@ -96,7 +96,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); // Create a zone and make sure it's in the response @@ -129,7 +130,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -215,7 +217,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -279,7 +282,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -377,7 +381,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -402,7 +407,9 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { // Create a zone $zone = $this->create_shipping_zone( - 'Zone 1', 0, array( + 'Zone 1', + 0, + array( array( 'code' => 'US', 'type' => 'country', @@ -433,7 +440,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } @@ -534,7 +542,8 @@ class WC_Tests_API_Shipping_Zones_V2 extends WC_REST_Unit_Test_Case { ), ), ), - ), $data + ), + $data ); } diff --git a/tests/unit-tests/api/wc-blocks/products-attributes.php b/tests/unit-tests/api/wc-blocks/products-attributes.php index 3a6221368bc..8a03a7b02e7 100644 --- a/tests/unit-tests/api/wc-blocks/products-attributes.php +++ b/tests/unit-tests/api/wc-blocks/products-attributes.php @@ -51,7 +51,7 @@ class WC_Tests_API_Products_Attributes_Controller extends WC_REST_Unit_Test_Case wp_set_current_user( $this->user ); $request = new WP_REST_Request( 'GET', $this->endpoint . '/products/attributes' ); - $response = $this->server->dispatch( $request ); + $response = $this->server->dispatch( $request ); $response_attributes = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $response_attributes ) ); @@ -96,7 +96,7 @@ class WC_Tests_API_Products_Attributes_Controller extends WC_REST_Unit_Test_Case wp_set_current_user( $this->contributor ); $request = new WP_REST_Request( 'GET', $this->endpoint . '/products/attributes/' . $this->attr_size['attribute_id'] ); - $response = $this->server->dispatch( $request ); + $response = $this->server->dispatch( $request ); $attribute = $response->get_data(); $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( $this->attr_size['attribute_id'], $attribute['id'] ); diff --git a/tests/unit-tests/attributes/functions.php b/tests/unit-tests/attributes/functions.php index 86392e410ad..a7d0d7e4aaa 100644 --- a/tests/unit-tests/attributes/functions.php +++ b/tests/unit-tests/attributes/functions.php @@ -125,7 +125,7 @@ class WC_Tests_Attributes_Functions extends WC_Unit_Test_Case { 'is_variation' => 0, 'is_taxonomy' => 1, ); - $local_before = isset( $product_meta_before_update['Test Local Attribute'] ) ? $product_meta_before_update['Test Local Attribute'] : $product_meta_before_update['test-local-attribute']; + $local_before = isset( $product_meta_before_update['Test Local Attribute'] ) ? $product_meta_before_update['Test Local Attribute'] : $product_meta_before_update['test-local-attribute']; $this->assertEquals( $expected_local_attribute_data, $local_before ); $this->assertEquals( $expected_global_attribute_data, $product_meta_before_update['pa_test'] ); diff --git a/tests/unit-tests/cart/cart-fees.php b/tests/unit-tests/cart/cart-fees.php index 5b0fdeaf9e4..20721913ccc 100644 --- a/tests/unit-tests/cart/cart-fees.php +++ b/tests/unit-tests/cart/cart-fees.php @@ -18,8 +18,8 @@ class WC_Tests_WC_Cart_Fees extends WC_Unit_Test_Case { // Test add_fee. $args = array( - 'name' => 'testfee', - 'amount' => 10, + 'name' => 'testfee', + 'amount' => 10, ); $cart_fees->add_fee( $args ); $applied_fees = $cart_fees->get_fees(); @@ -34,14 +34,14 @@ class WC_Tests_WC_Cart_Fees extends WC_Unit_Test_Case { // Test set_fees. $args = array( array( - 'name' => 'newfee', - 'amount' => -5, + 'name' => 'newfee', + 'amount' => -5, ), array( 'name' => 'newfee2', 'amount' => 10, 'tax_class' => 'Reduced rate', - 'taxable' => true + 'taxable' => true, ), ); $cart_fees->set_fees( $args ); diff --git a/tests/unit-tests/cart/cart.php b/tests/unit-tests/cart/cart.php index 2ed624211a8..b4f83a89622 100644 --- a/tests/unit-tests/cart/cart.php +++ b/tests/unit-tests/cart/cart.php @@ -109,7 +109,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { update_option( 'woocommerce_calc_taxes', 'yes' ); update_option( 'woocommerce_tax_round_at_subtotal', 'yes' ); - $tax_rate = array( + $tax_rate = array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '23.0000', @@ -122,7 +122,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { ); $tax_rate_23 = WC_Tax::_insert_tax_rate( $tax_rate ); - $tax_rate = array( + $tax_rate = array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '5.0000', @@ -196,7 +196,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { */ public function test_cart_get_discounted_price_issue_10963() { // Create dummy coupon - fixed cart, 1 value - $coupon = WC_Helper_Coupon::create_coupon(); + $coupon = WC_Helper_Coupon::create_coupon(); // Add coupon WC()->cart->add_discount( $coupon->get_code() ); @@ -290,7 +290,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { */ public function test_cart_get_discounted_price_issue_10573() { // Create dummy coupon - fixed cart, 1 value - $coupon = WC_Helper_Coupon::create_coupon(); + $coupon = WC_Helper_Coupon::create_coupon(); // Create dummy product - price will be 10 $product = WC_Helper_Product::create_simple_product(); @@ -1580,7 +1580,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { } public function test_add_individual_use_coupon_removal() { - $coupon = WC_Helper_Coupon::create_coupon(); + $coupon = WC_Helper_Coupon::create_coupon(); $iu_coupon = WC_Helper_Coupon::create_coupon( 'code1' ); $iu_coupon->set_individual_use( true ); $iu_coupon->save(); @@ -1649,7 +1649,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { $new_cart = clone $cart; // Get the properties from each object. - $cart_fees = $cart->fees_api(); + $cart_fees = $cart->fees_api(); $new_cart_fees = $new_cart->fees_api(); // Ensure that cloned properties are not identical. diff --git a/tests/unit-tests/countries/countries.php b/tests/unit-tests/countries/countries.php index 425405e00b0..fe5c5c4885e 100644 --- a/tests/unit-tests/countries/countries.php +++ b/tests/unit-tests/countries/countries.php @@ -27,7 +27,7 @@ class WC_Tests_Countries extends WC_Unit_Test_Case { * @since 3.6.0 */ public function test_get_shipping_continents() { - $countries = new WC_Countries(); + $countries = new WC_Countries(); $all_continents = $countries->get_continents(); update_option( 'woocommerce_ship_to_countries', 'all' ); @@ -110,7 +110,7 @@ class WC_Tests_Countries extends WC_Unit_Test_Case { update_option( 'woocommerce_specific_allowed_countries', array( 'US' ) ); $all_states = $countries->get_allowed_country_states(); - $us_states = $all_states['US']; + $us_states = $all_states['US']; $this->assertEquals( 'Oregon', $us_states['OR'] ); $this->assertGreaterThanOrEqual( 50, count( $us_states ) ); @@ -134,7 +134,7 @@ class WC_Tests_Countries extends WC_Unit_Test_Case { update_option( 'woocommerce_specific_ship_to_countries', array( 'US' ) ); $all_states = $countries->get_shipping_country_states(); - $us_states = $all_states['US']; + $us_states = $all_states['US']; $this->assertEquals( 'Oregon', $us_states['OR'] ); $this->assertGreaterThanOrEqual( 50, count( $us_states ) ); diff --git a/tests/unit-tests/coupon/coupon.php b/tests/unit-tests/coupon/coupon.php index 05c4c954479..75922d17e02 100644 --- a/tests/unit-tests/coupon/coupon.php +++ b/tests/unit-tests/coupon/coupon.php @@ -235,11 +235,14 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case { update_post_meta( $product->get_id(), '_regular_price', '10' ); // Create coupon - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon', array( - 'discount_type' => 'percent', - 'coupon_amount' => '5', - 'limit_usage_to_x_items' => 1, - ) ); + $coupon = WC_Helper_Coupon::create_coupon( + 'dummycoupon', + array( + 'discount_type' => 'percent', + 'coupon_amount' => '5', + 'limit_usage_to_x_items' => 1, + ) + ); // We need this to have the calculate_totals() method calculate totals. if ( ! defined( 'WOOCOMMERCE_CHECKOUT' ) ) { @@ -265,11 +268,14 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case { update_post_meta( $product->get_id(), '_regular_price', '10' ); // Create coupon - $coupon = WC_Helper_Coupon::create_coupon( 'dummycoupon', array( - 'discount_type' => __FUNCTION__, - 'coupon_amount' => '5', - 'limit_usage_to_x_items' => 1, - ) ); + $coupon = WC_Helper_Coupon::create_coupon( + 'dummycoupon', + array( + 'discount_type' => __FUNCTION__, + 'coupon_amount' => '5', + 'limit_usage_to_x_items' => 1, + ) + ); // Add 4 products and coupon to cart. WC()->cart->add_to_cart( $product->get_id(), 4 ); diff --git a/tests/unit-tests/coupon/data.php b/tests/unit-tests/coupon/data.php index 66c8890354b..e1a1f30fd25 100644 --- a/tests/unit-tests/coupon/data.php +++ b/tests/unit-tests/coupon/data.php @@ -94,24 +94,27 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case { public function test_read_manual_coupon() { $code = 'manual_coupon_' . time(); $coupon = new WC_Coupon( $code ); - $coupon->read_manual_coupon( $code, array( - 'id' => true, - 'type' => 'fixed_cart', - 'amount' => 0, - 'individual_use' => true, - 'product_ids' => array(), - 'exclude_product_ids' => array(), - 'usage_limit' => '', - 'usage_count' => '', - 'expiry_date' => '', - 'free_shipping' => false, - 'product_categories' => array(), - 'exclude_product_categories' => array(), - 'exclude_sale_items' => false, - 'minimum_amount' => '', - 'maximum_amount' => 100, - 'customer_email' => '', - ) ); + $coupon->read_manual_coupon( + $code, + array( + 'id' => true, + 'type' => 'fixed_cart', + 'amount' => 0, + 'individual_use' => true, + 'product_ids' => array(), + 'exclude_product_ids' => array(), + 'usage_limit' => '', + 'usage_count' => '', + 'expiry_date' => '', + 'free_shipping' => false, + 'product_categories' => array(), + 'exclude_product_categories' => array(), + 'exclude_sale_items' => false, + 'minimum_amount' => '', + 'maximum_amount' => 100, + 'customer_email' => '', + ) + ); $this->assertEquals( $code, $coupon->get_code() ); $this->assertTrue( $coupon->get_individual_use() ); $this->assertEquals( 100, $coupon->get_maximum_amount() ); @@ -132,24 +135,27 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case { $this->expected_doing_it_wrong = array_merge( $this->expected_doing_it_wrong, $legacy_keys ); $code = 'bc_manual_coupon_' . time(); $coupon = new WC_Coupon( $code ); - $coupon->read_manual_coupon( $code, array( - 'id' => true, - 'type' => 'fixed_cart', - 'amount' => 0, - 'individual_use' => 'yes', - 'product_ids' => '', - 'exclude_product_ids' => '5,6', - 'usage_limit' => '', - 'usage_count' => '', - 'expiry_date' => '', - 'free_shipping' => 'no', - 'product_categories' => array(), - 'exclude_product_categories' => array(), - 'exclude_sale_items' => 'no', - 'minimum_amount' => '', - 'maximum_amount' => 100, - 'customer_email' => '', - ) ); + $coupon->read_manual_coupon( + $code, + array( + 'id' => true, + 'type' => 'fixed_cart', + 'amount' => 0, + 'individual_use' => 'yes', + 'product_ids' => '', + 'exclude_product_ids' => '5,6', + 'usage_limit' => '', + 'usage_count' => '', + 'expiry_date' => '', + 'free_shipping' => 'no', + 'product_categories' => array(), + 'exclude_product_categories' => array(), + 'exclude_sale_items' => 'no', + 'minimum_amount' => '', + 'maximum_amount' => 100, + 'customer_email' => '', + ) + ); $this->assertEquals( $code, $coupon->get_code() ); $this->assertTrue( $coupon->get_individual_use() ); $this->assertFalse( $coupon->get_free_shipping() ); diff --git a/tests/unit-tests/crud/data-store.php b/tests/unit-tests/crud/data-store.php index efc923b4ebf..e57a3f3ec1e 100644 --- a/tests/unit-tests/crud/data-store.php +++ b/tests/unit-tests/crud/data-store.php @@ -75,7 +75,7 @@ class WC_Tests_Data_Store extends WC_Unit_Test_Case { * @since 3.0.0 */ function load_dummy_store() { - include_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/framework/class-wc-dummy-data-store.php' ); + include_once dirname( dirname( dirname( __FILE__ ) ) ) . '/framework/class-wc-dummy-data-store.php'; add_filter( 'woocommerce_data_stores', array( $this, 'add_dummy_data_store' ) ); } diff --git a/tests/unit-tests/crud/data.php b/tests/unit-tests/crud/data.php index 48269c18f89..efeb7466cff 100644 --- a/tests/unit-tests/crud/data.php +++ b/tests/unit-tests/crud/data.php @@ -9,8 +9,8 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { /** * Restore UTC on failire. */ - public function tearDown() { - parent::tearDown(); + public function tearDown() { + parent::tearDown(); // @codingStandardsIgnoreStart date_default_timezone_set( 'UTC' ); // @codingStandardsIgnoreEnd @@ -63,9 +63,9 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test: delete_meta_data_by_mid */ function test_delete_meta_data_by_mid() { - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); - $meta_id = add_metadata( 'post', $object_id, 'test_meta_key', 'val1', true ); + $meta_id = add_metadata( 'post', $object_id, 'test_meta_key', 'val1', true ); $object->delete_meta_data_by_mid( $meta_id ); $this->assertEmpty( $object->get_meta( 'test_meta_key' ) ); } @@ -74,12 +74,12 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test: set_props */ function test_set_props() { - $object = new WC_Mock_WC_Data(); + $object = new WC_Mock_WC_Data(); $data_to_set = array( 'content' => 'I am a fish', 'bool_value' => true, ); - $result = $object->set_props( $data_to_set ); + $result = $object->set_props( $data_to_set ); $this->assertFalse( is_wp_error( $result ) ); $this->assertEquals( 'I am a fish', $object->get_content() ); $this->assertTrue( $object->get_bool_value() ); @@ -88,7 +88,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { 'content' => 'I am also a fish', 'bool_value' => 'thisisinvalid', ); - $result = $object->set_props( $data_to_set ); + $result = $object->set_props( $data_to_set ); $this->assertTrue( is_wp_error( $result ) ); $this->assertEquals( 'I am also a fish', $object->get_content() ); $this->assertNotEquals( 'thisisinvalid', $object->get_bool_value() ); @@ -119,14 +119,14 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Tests that the meta data cache is not shared among instances. */ function test_get_meta_data_shared_bug() { - $object = new WC_Order; + $object = new WC_Order(); $object->add_meta_data( 'test_meta_key', 'val1', true ); $object->add_meta_data( 'test_multi_meta_key', 'val2' ); $object->add_meta_data( 'test_multi_meta_key', 'val3' ); $object->save(); - $order = new WC_Order( $object->get_id() ); - $metas = $order->get_meta_data(); + $order = new WC_Order( $object->get_id() ); + $metas = $order->get_meta_data(); $metas[0]->value = 'wrong value'; $order = new WC_Order( $object->get_id() ); @@ -138,14 +138,14 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Tests the cache invalidation after an order is saved */ function test_get_meta_data_cache_invalidation() { - $object = new WC_Order; + $object = new WC_Order(); $object->add_meta_data( 'test_meta_key', 'val1', true ); $object->add_meta_data( 'test_multi_meta_key', 'val2' ); $object->add_meta_data( 'test_multi_meta_key', 'val3' ); $object->save(); - $order = new WC_Order( $object->get_id() ); - $metas = $order->get_meta_data(); + $order = new WC_Order( $object->get_id() ); + $metas = $order->get_meta_data(); $metas[0]->value = 'updated value'; $order->save(); @@ -155,14 +155,14 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { } function test_get_meta_data_cache_invalidation_array_to_scalar() { - $object = new WC_Order; + $object = new WC_Order(); $object->add_meta_data( 'test_meta_key', array( 'val1' ), true ); $object->add_meta_data( 'test_multi_meta_key', 'val2' ); $object->add_meta_data( 'test_multi_meta_key', 'val3' ); $object->save(); - $order = new WC_Order( $object->get_id() ); - $metas = $order->get_meta_data(); + $order = new WC_Order( $object->get_id() ); + $metas = $order->get_meta_data(); $metas[0]->value = 'updated value'; $order->save(); @@ -175,7 +175,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test getting meta by ID. */ function test_get_meta() { - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); $object->add_meta_data( 'test_meta_key', 'val1', true ); $object->add_meta_data( 'test_multi_meta_key', 'val2' ); @@ -218,11 +218,11 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test getting meta that hasn't been set */ function test_get_meta_no_meta() { - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); - $object = new WC_Mock_WC_Data( $object_id ); + $object = new WC_Mock_WC_Data( $object_id ); - $single_on = $object->get_meta( 'doesnt-exist', true ); + $single_on = $object->get_meta( 'doesnt-exist', true ); $single_off = $object->get_meta( 'also-doesnt-exist', false ); $this->assertEquals( '', $single_on ); @@ -234,18 +234,23 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { */ function test_set_meta_data() { global $wpdb; - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); add_metadata( 'post', $object_id, 'test_meta_key', 'val1', true ); add_metadata( 'post', $object_id, 'test_meta_key_2', 'val2', true ); $object = new WC_Mock_WC_Data( $object_id ); $metadata = array(); - $raw_metadata = $wpdb->get_results( $wpdb->prepare( " + $raw_metadata = $wpdb->get_results( + $wpdb->prepare( + " SELECT meta_id, meta_key, meta_value FROM {$wpdb->prefix}postmeta WHERE post_id = %d ORDER BY meta_id - ", $object_id ) ); + ", + $object_id + ) + ); foreach ( $raw_metadata as $meta ) { $metadata[] = (object) array( @@ -270,9 +275,9 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test adding meta data. */ function test_add_meta_data() { - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); - $data = 'add_meta_data_' . time(); + $data = 'add_meta_data_' . time(); $object->add_meta_data( 'test_new_field', $data ); $meta = $object->get_meta( 'test_new_field' ); $this->assertEquals( $data, $meta ); @@ -283,19 +288,24 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { */ function test_update_meta_data() { global $wpdb; - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); add_metadata( 'post', $object_id, 'test_meta_key', 'val1', true ); $object = new WC_Mock_WC_Data( $object_id ); $this->assertEquals( 'val1', $object->get_meta( 'test_meta_key' ) ); - $metadata = array(); - $meta_id = $wpdb->get_var( $wpdb->prepare( " + $metadata = array(); + $meta_id = $wpdb->get_var( + $wpdb->prepare( + " SELECT meta_id FROM {$wpdb->prefix}postmeta WHERE post_id = %d LIMIT 1 - ", $object_id ) ); + ", + $object_id + ) + ); $object->update_meta_data( 'test_meta_key', 'updated_value', $meta_id ); $this->assertEquals( 'updated_value', $object->get_meta( 'test_meta_key' ) ); @@ -305,7 +315,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test deleting meta. */ function test_delete_meta_data() { - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); add_metadata( 'post', $object_id, 'test_meta_key', 'val1', true ); $object = new WC_Mock_WC_Data( $object_id ); @@ -323,18 +333,23 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { */ function test_save_meta_data() { global $wpdb; - $object = $this->create_test_post(); + $object = $this->create_test_post(); $object_id = $object->get_id(); $object->add_meta_data( 'test_meta_key', 'val1', true ); $object->add_meta_data( 'test_meta_key_2', 'val2', true ); $object->save_meta_data(); $object = new WC_Mock_WC_Data( $object_id ); - $raw_metadata = $wpdb->get_results( $wpdb->prepare( " + $raw_metadata = $wpdb->get_results( + $wpdb->prepare( + " SELECT meta_id, meta_key, meta_value FROM {$wpdb->prefix}postmeta WHERE post_id = %d ORDER BY meta_id - ", $object_id ) ); + ", + $object_id + ) + ); $object->delete_meta_data( 'test_meta_key' ); $object->update_meta_data( 'test_meta_key_2', 'updated_value', $raw_metadata[1]->meta_id ); @@ -350,7 +365,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * Test reading/getting user meta data too. */ function test_usermeta() { - $object = $this->create_test_user(); + $object = $this->create_test_user(); $object_id = $object->get_id(); $object->add_meta_data( 'test_meta_key', 'val1', true ); $object->add_meta_data( 'test_meta_key_2', 'val2', true ); @@ -365,7 +380,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { * data before a save. */ function test_add_meta_data_overwrite_before_save() { - $object = new WC_Mock_WC_Data; + $object = new WC_Mock_WC_Data(); $object->add_meta_data( 'test_field_0', 'another field', true ); $object->add_meta_data( 'test_field_1', 'another field', true ); $object->add_meta_data( 'test_field_2', 'val1', true ); @@ -504,12 +519,12 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { 'prop3' => 'value3', ); - $object = new WC_Mock_WC_Data; + $object = new WC_Mock_WC_Data(); $object->set_data( $data ); $object->set_changes( $changes ); $object->apply_changes(); - $new_data = $object->get_data(); + $new_data = $object->get_data(); $new_changes = $object->get_changes(); $this->assertEquals( 'new_value1', $new_data['prop1'] ); @@ -537,7 +552,7 @@ class WC_Tests_CRUD_Data extends WC_Unit_Test_Case { ), ); - $object = new WC_Mock_WC_Data; + $object = new WC_Mock_WC_Data(); $object->set_data( $data ); $object->set_changes( $changes ); $object->apply_changes(); diff --git a/tests/unit-tests/crud/meta.php b/tests/unit-tests/crud/meta.php index 180ecf40704..3bcc8da38d8 100644 --- a/tests/unit-tests/crud/meta.php +++ b/tests/unit-tests/crud/meta.php @@ -36,7 +36,7 @@ class WC_Tests_CRUD_Meta_Data extends WC_Unit_Test_Case { */ function test_disappearing_item_meta() { // Setup for testing by making an item. - $item = new WC_Order_Item_Product(); + $item = new WC_Order_Item_Product(); $this->item_id = $item->save(); $item = WC_Order_Factory::get_order_item( $this->item_id ); @@ -78,7 +78,7 @@ class WC_Tests_CRUD_Meta_Data extends WC_Unit_Test_Case { */ function test_disappearing_order_meta() { // Setup for testing by making an item. - $order = new WC_Order(); + $order = new WC_Order(); $this->order_id = $order->save(); $order = wc_get_order( $this->order_id ); @@ -119,7 +119,7 @@ class WC_Tests_CRUD_Meta_Data extends WC_Unit_Test_Case { */ function test_get_meta_data_after_update_post_meta() { // Create an object. - $object = new WC_Product; + $object = new WC_Product(); $object->save(); // Update a meta value. @@ -138,8 +138,8 @@ class WC_Tests_CRUD_Meta_Data extends WC_Unit_Test_Case { */ function test_strings_in_meta() { // Create objects. - $object = new WC_Product; - $object_to_store = new stdClass(); + $object = new WC_Product(); + $object_to_store = new stdClass(); $object_to_store->prop1 = 'prop_value'; $object_to_store->prop2 = 'prop_value_with_\\\"quotes"'; @@ -149,7 +149,7 @@ class WC_Tests_CRUD_Meta_Data extends WC_Unit_Test_Case { // Get object and check it. $object = wc_get_product( $object_id ); - $value = $object->get_meta( 'Test Object', true ); + $value = $object->get_meta( 'Test Object', true ); $this->assertEquals( $object_to_store, $object->get_meta( 'Test Object', true ) ); $this->assertEquals( 'Test\slashes', $object->get_meta( 'Test meta with slash', true ) ); diff --git a/tests/unit-tests/crud/query.php b/tests/unit-tests/crud/query.php index 2950bc90206..ef86b290af2 100644 --- a/tests/unit-tests/crud/query.php +++ b/tests/unit-tests/crud/query.php @@ -26,7 +26,7 @@ class WC_Tests_WC_Object_Query extends WC_Unit_Test_Case { * @since 3.1.0 */ function test_query_with_args() { - $args = array( + $args = array( 'limit' => 15, ); $query = new WC_Mock_WC_Object_Query( $args ); diff --git a/tests/unit-tests/customer/crud.php b/tests/unit-tests/customer/crud.php index f121418b675..8de4e2e725e 100644 --- a/tests/unit-tests/customer/crud.php +++ b/tests/unit-tests/customer/crud.php @@ -29,7 +29,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_update_customer() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $this->assertEquals( 'test@woo.local', $customer->get_email() ); $this->assertEquals( 'Apt 1', $customer->get_billing_address_2() ); @@ -58,7 +58,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { $this->assertEquals( 0, $customer->get_id() ); $customer->save(); $customer_id = $customer->get_id(); - $wp_user = new WP_User( $customer->get_id() ); + $wp_user = new WP_User( $customer->get_id() ); $this->assertNotEquals( 0, $customer->get_id() ); @@ -76,7 +76,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_delete_customer() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $this->assertNotEquals( 0, $customer->get_id() ); $customer->delete(); @@ -97,7 +97,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { $customer->set_last_name( 'Bob' ); $customer->set_display_name( 'Billy Bob' ); $customer->save(); - $customer_id = $customer->get_id(); + $customer_id = $customer->get_id(); $customer_read = new WC_Customer( $customer_id ); $this->assertEquals( $customer_id, $customer_read->get_id() ); @@ -179,35 +179,35 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_setters_and_getters() { - $time = time(); + $time = time(); $setters = array( - 'username' => 'test', - 'email' => 'test@woo.local', - 'first_name' => 'Bob', - 'last_name' => 'tester', - 'display_name' => 'Bob Tester', - 'role' => 'customer', - 'date_created' => $time, - 'date_modified' => $time, - 'billing_postcode' => 11010, - 'billing_city' => 'New York', - 'billing_address' => '123 Main St.', - 'billing_address_1' => '123 Main St.', - 'billing_address_2' => 'Apt 2', - 'billing_state' => 'NY', - 'billing_country' => 'US', - 'shipping_state' => 'NY', - 'shipping_postcode' => 11011, - 'shipping_city' => 'New York', - 'shipping_address' => '123 Main St.', - 'shipping_address_1' => '123 Main St.', - 'shipping_address_2' => 'Apt 2', - 'is_vat_exempt' => true, + 'username' => 'test', + 'email' => 'test@woo.local', + 'first_name' => 'Bob', + 'last_name' => 'tester', + 'display_name' => 'Bob Tester', + 'role' => 'customer', + 'date_created' => $time, + 'date_modified' => $time, + 'billing_postcode' => 11010, + 'billing_city' => 'New York', + 'billing_address' => '123 Main St.', + 'billing_address_1' => '123 Main St.', + 'billing_address_2' => 'Apt 2', + 'billing_state' => 'NY', + 'billing_country' => 'US', + 'shipping_state' => 'NY', + 'shipping_postcode' => 11011, + 'shipping_city' => 'New York', + 'shipping_address' => '123 Main St.', + 'shipping_address_1' => '123 Main St.', + 'shipping_address_2' => 'Apt 2', + 'is_vat_exempt' => true, 'calculated_shipping' => true, - 'is_paying_customer' => true, + 'is_paying_customer' => true, ); - $customer = new WC_Customer; + $customer = new WC_Customer(); foreach ( $setters as $method => $value ) { $customer->{"set_{$method}"}( $value ); @@ -220,7 +220,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { } // Get timestamps from date_created and date_modified. - $getters['date_created'] = $getters['date_created']->getOffsetTimestamp(); + $getters['date_created'] = $getters['date_created']->getOffsetTimestamp(); $getters['date_modified'] = $getters['date_modified']->getOffsetTimestamp(); $this->assertEquals( $setters, $getters ); @@ -231,11 +231,11 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_last_order_info() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); - $order = WC_Helper_Order::create_order( $customer_id ); - $customer = new WC_Customer( $customer_id ); - $last_order = $customer->get_last_order(); + $order = WC_Helper_Order::create_order( $customer_id ); + $customer = new WC_Customer( $customer_id ); + $last_order = $customer->get_last_order(); $this->assertEquals( $order->get_id(), $last_order ? $last_order->get_id() : 0 ); $this->assertEquals( $order->get_date_created(), $last_order ? $last_order->get_date_created() : 0 ); $order->delete(); @@ -246,7 +246,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_order_count_read() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); WC_Helper_Order::create_order( $customer_id ); WC_Helper_Order::create_order( $customer_id ); @@ -260,10 +260,10 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_total_spent_read() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); - $order = WC_Helper_Order::create_order( $customer_id ); - $customer = new WC_Customer( $customer_id ); + $order = WC_Helper_Order::create_order( $customer_id ); + $customer = new WC_Customer( $customer_id ); $this->assertEquals( 0, $customer->get_total_spent() ); $order->update_status( 'wc-completed' ); $customer = new WC_Customer( $customer_id ); @@ -286,9 +286,9 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_date_created_read() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); - $user = new WP_User( $customer_id ); + $user = new WP_User( $customer_id ); $this->assertEquals( strtotime( $user->data->user_registered ), $customer->get_date_created()->getOffsetTimestamp() ); } @@ -297,9 +297,9 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_date_modified_read() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); - $last = get_user_meta( $customer_id, 'last_update', true ); + $last = get_user_meta( $customer_id, 'last_update', true ); sleep( 1 ); $this->assertEquals( $last, $customer->get_date_modified()->getOffsetTimestamp() ); $customer->set_billing_address( '1234 Some St.' ); @@ -314,7 +314,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_taxable_address() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $customer->set_shipping_postcode( '11111' ); $customer->set_shipping_city( 'Test' ); @@ -348,7 +348,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_get_downloadable_products() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $this->assertEquals( wc_get_customer_available_downloads( $customer_id ), $customer->get_downloadable_products() ); } @@ -358,7 +358,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_customer_password() { - $customer = WC_Helper_Customer::create_customer(); + $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $user = get_user_by( 'id', $customer_id ); @@ -460,7 +460,7 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { // should still be session ID, not a created row, since we are working with guests/sessions $this->assertFalse( $session->get_id() > 0 ); - $this->assertEquals( '32191' , $session->get_billing_postcode() ); + $this->assertEquals( '32191', $session->get_billing_postcode() ); } /** @@ -468,12 +468,12 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_get_meta() { - $customer = WC_Helper_Customer::create_customer(); - $customer_id = $customer->get_id(); - $meta_value = time() . '-custom-value'; + $customer = WC_Helper_Customer::create_customer(); + $customer_id = $customer->get_id(); + $meta_value = time() . '-custom-value'; add_user_meta( $customer_id, 'test_field', $meta_value, true ); $customer = new WC_Customer( $customer_id ); - $fields = $customer->get_meta_data(); + $fields = $customer->get_meta_data(); $this->assertEquals( $meta_value, $customer->get_meta( 'test_field' ) ); } @@ -482,9 +482,9 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_set_meta() { - $customer = WC_Helper_Customer::create_customer(); - $customer_id = $customer->get_id(); - $meta_value = time() . '-custom-value'; + $customer = WC_Helper_Customer::create_customer(); + $customer_id = $customer->get_id(); + $meta_value = time() . '-custom-value'; $customer->add_meta_data( 'my-field', $meta_value, true ); $customer->save(); $customer = new WC_Customer( $customer_id ); diff --git a/tests/unit-tests/customer/customer-download-log.php b/tests/unit-tests/customer/customer-download-log.php index 0a67b82e699..df327447097 100644 --- a/tests/unit-tests/customer/customer-download-log.php +++ b/tests/unit-tests/customer/customer-download-log.php @@ -137,9 +137,11 @@ class WC_Tests_Customer_Download_Log extends WC_Unit_Test_Case { // Make sure download log was recorded properly. $data_store = WC_Data_Store::load( 'customer-download-log' ); - $download_logs = $data_store->get_download_logs( array( - 'permission_id' => $download_1->get_id(), - ) ); + $download_logs = $data_store->get_download_logs( + array( + 'permission_id' => $download_1->get_id(), + ) + ); $this->assertEquals( 1, count( $download_logs ), 'After single download, permission should have one download log in database.' ); diff --git a/tests/unit-tests/customer/functions.php b/tests/unit-tests/customer/functions.php index f8a441a5082..cbcf923fd86 100644 --- a/tests/unit-tests/customer/functions.php +++ b/tests/unit-tests/customer/functions.php @@ -98,7 +98,7 @@ class WC_Tests_Customer_Functions extends WC_Unit_Test_Case { 'bob@bobbobson.com', array( 'first_name' => 'Bob', - 'last_name' => 'Bobson', + 'last_name' => 'Bobson', ) ) ); @@ -110,7 +110,7 @@ class WC_Tests_Customer_Functions extends WC_Unit_Test_Case { 'unicode@unicode.com', array( 'first_name' => 'こんにちは', - 'last_name' => 'こんにちは', + 'last_name' => 'こんにちは', ) ) ); diff --git a/tests/unit-tests/discounts/discounts.php b/tests/unit-tests/discounts/discounts.php index 41435e5d1a8..6bae5edfc64 100644 --- a/tests/unit-tests/discounts/discounts.php +++ b/tests/unit-tests/discounts/discounts.php @@ -59,9 +59,9 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { public function setUp() { parent::setUp(); - $this->products = array(); - $this->coupons = array(); - $this->orders = array(); + $this->products = array(); + $this->coupons = array(); + $this->orders = array(); $this->last_test_data = null; } @@ -159,8 +159,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { */ public function test_calculations( $test_data ) { $this->last_test_data = $test_data; - $discounts = new WC_Discounts(); - $products = array(); + $discounts = new WC_Discounts(); + $products = array(); if ( isset( $test_data['tax_rate'] ) ) { WC_Tax::_insert_tax_rate( $test_data['tax_rate'] ); @@ -209,7 +209,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { return array( array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -220,20 +220,20 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'wc_options' => array( + 'wc_options' => array( 'woocommerce_calc_taxes' => array( 'set' => 'yes', 'revert' => 'no', ), ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -245,7 +245,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -256,14 +256,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -275,7 +275,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -286,8 +286,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 1, @@ -297,7 +297,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -309,7 +309,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -320,8 +320,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 1, @@ -335,7 +335,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -347,7 +347,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -358,8 +358,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, @@ -373,7 +373,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 2, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -385,7 +385,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -396,8 +396,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 1, @@ -443,7 +443,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -455,7 +455,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -466,8 +466,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 1, 'qty' => 1, @@ -481,7 +481,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_cart', @@ -493,7 +493,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -504,14 +504,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -524,7 +524,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'tax_rate' => array( + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -535,8 +535,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, @@ -546,7 +546,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 2, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -559,8 +559,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. No limits. Not discounting sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. No limits. Not discounting sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -571,8 +571,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, @@ -582,16 +582,16 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'percent', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'percent', + 'amount' => '10', ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 7.5, @@ -599,8 +599,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. One coupon has limit up to one item. Not discounting sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. One coupon has limit up to one item. Not discounting sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -611,8 +611,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 2, @@ -622,7 +622,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -630,9 +630,9 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'limit_usage_to_x_items' => 1, ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 6, @@ -640,8 +640,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. No limits. Discounting sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. No limits. Discounting sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -652,14 +652,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'wc_options' => array( + 'prices_include_tax' => false, + 'wc_options' => array( 'woocommerce_calc_discounts_sequentially' => array( 'set' => 'yes', 'revert' => 'no', ), ), - 'cart' => array( + 'cart' => array( array( 'price' => 10, 'qty' => 2, @@ -669,16 +669,16 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'percent', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'percent', + 'amount' => '10', ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 7, @@ -686,8 +686,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. No limits. Discounting sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. No limits. Discounting sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -698,14 +698,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'wc_options' => array( + 'prices_include_tax' => false, + 'wc_options' => array( 'woocommerce_calc_discounts_sequentially' => array( 'set' => 'yes', 'revert' => 'no', ), ), - 'cart' => array( + 'cart' => array( array( 'price' => 1.80, 'qty' => 10, @@ -715,16 +715,16 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'percent', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'percent', + 'amount' => '10', ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 16.75, @@ -732,8 +732,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting non-sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting non-sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -744,8 +744,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 3, @@ -755,7 +755,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -763,9 +763,9 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'limit_usage_to_x_items' => 5, ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 21, @@ -773,8 +773,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting sequentially.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting sequentially.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -785,14 +785,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'wc_options' => array( + 'prices_include_tax' => false, + 'wc_options' => array( 'woocommerce_calc_discounts_sequentially' => array( 'set' => 'yes', 'revert' => 'no', ), ), - 'cart' => array( + 'cart' => array( array( 'price' => 10, 'qty' => 3, @@ -802,11 +802,11 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), array( 'code' => 'test', @@ -820,8 +820,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting sequentially. Multiple zero-dollar items.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons. One coupon has limit up to 5 item. Discounting sequentially. Multiple zero-dollar items.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -832,14 +832,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'wc_options' => array( + 'prices_include_tax' => false, + 'wc_options' => array( 'woocommerce_calc_discounts_sequentially' => array( 'set' => 'yes', 'revert' => 'no', ), ), - 'cart' => array( + 'cart' => array( array( 'price' => 1.80, 'qty' => 3, @@ -869,7 +869,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'percent', @@ -877,9 +877,9 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'limit_usage_to_x_items' => 5, ), array( - 'code' => 'test1', - 'discount_type' => 'percent', - 'amount' => '20', + 'code' => 'test1', + 'discount_type' => 'percent', + 'amount' => '20', ), ), 'expected_total_discount' => 20.35, @@ -887,8 +887,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -899,18 +899,18 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'fixed_product', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'fixed_product', + 'amount' => '10', ), ), 'expected_total_discount' => 30, @@ -918,8 +918,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item. Coupon greater than item cost.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item. Coupon greater than item cost.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -930,18 +930,18 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'fixed_product', - 'amount' => '20', + 'code' => 'test', + 'discount_type' => 'fixed_product', + 'amount' => '20', ), ), 'expected_total_discount' => 41.85, @@ -949,8 +949,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item. Limit to one item.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item. Limit to one item.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -961,14 +961,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -981,8 +981,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item. Limit to one item. Price greater than product.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item. Limit to one item. Price greater than product.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -993,14 +993,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1013,8 +1013,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item. Limit to same number of items as product. Price same as product.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item. Limit to same number of items as product. Price same as product.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1025,14 +1025,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1045,8 +1045,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. No limit.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. No limit.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1057,8 +1057,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, @@ -1068,11 +1068,11 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 5, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'fixed_product', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'fixed_product', + 'amount' => '10', ), ), 'expected_total_discount' => 39, @@ -1080,8 +1080,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. Limit to same number of items as first product.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. Limit to same number of items as first product.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1092,8 +1092,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, @@ -1103,7 +1103,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 5, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1116,8 +1116,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1128,8 +1128,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, @@ -1139,7 +1139,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 5, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1152,8 +1152,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities. Amount less than price of either product.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than first product but less than total quantities. Amount less than price of either product.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1164,8 +1164,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, @@ -1175,7 +1175,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 5, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1188,8 +1188,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than both product quantities combined. Amount less than price of either product.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. Limit to number greater than both product quantities combined. Amount less than price of either product.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1200,8 +1200,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 13.95, 'qty' => 3, @@ -1211,7 +1211,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 5, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1224,8 +1224,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on two items. Limit to two items. Testing the products are sorted according to legacy method where first one to apply is the one with greatest price * quantity.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on two items. Limit to two items. Testing the products are sorted according to legacy method where first one to apply is the one with greatest price * quantity.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1236,8 +1236,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 1.80, 'qty' => 5, @@ -1247,7 +1247,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'qty' => 3, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'test', 'discount_type' => 'fixed_product', @@ -1260,8 +1260,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test single fixed product coupon on one item to illustrate type conversion precision bug.', - 'tax_rate' => array( + 'desc' => 'Test single fixed product coupon on one item to illustrate type conversion precision bug.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1272,18 +1272,18 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 8.95, 'qty' => 1, ), ), - 'coupons' => array( + 'coupons' => array( array( - 'code' => 'test', - 'discount_type' => 'fixed_product', - 'amount' => '10', + 'code' => 'test', + 'discount_type' => 'fixed_product', + 'amount' => '10', ), ), 'expected_total_discount' => 8.95, @@ -1291,8 +1291,8 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { ), array( array( - 'desc' => 'Test multiple coupons with limits of 1.', - 'tax_rate' => array( + 'desc' => 'Test multiple coupons with limits of 1.', + 'tax_rate' => array( 'tax_rate_country' => '', 'tax_rate_state' => '', 'tax_rate' => '20.0000', @@ -1303,14 +1303,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '', ), - 'prices_include_tax' => false, - 'cart' => array( + 'prices_include_tax' => false, + 'cart' => array( array( 'price' => 10, 'qty' => 4, ), ), - 'coupons' => array( + 'coupons' => array( array( 'code' => 'one', 'discount_type' => 'fixed_product', @@ -1338,12 +1338,14 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { public function test_free_shipping_coupon_no_products() { $discounts = new WC_Discounts(); - $coupon = WC_Helper_Coupon::create_coupon( 'freeshipping' ); - $coupon->set_props( array( - 'discount_type' => 'percent', - 'amount' => '', - 'free_shipping' => 'yes', - )); + $coupon = WC_Helper_Coupon::create_coupon( 'freeshipping' ); + $coupon->set_props( + array( + 'discount_type' => 'percent', + 'amount' => '', + 'free_shipping' => 'yes', + ) + ); $discounts->apply_coupon( $coupon ); @@ -1373,11 +1375,13 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { WC()->cart->add_to_cart( $product2->get_id(), 1 ); $coupon = WC_Helper_Coupon::create_coupon( 'test' ); - $coupon->set_props( array( - 'code' => 'test', - 'discount_type' => 'percent', - 'amount' => '20', - ) ); + $coupon->set_props( + array( + 'code' => 'test', + 'discount_type' => 'percent', + 'amount' => '20', + ) + ); $discounts->set_items_from_cart( WC()->cart ); $discounts->apply_coupon( $coupon ); @@ -1410,19 +1414,23 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { $product_sale->save(); $coupon_percent = new WC_Coupon(); - $coupon_percent->set_props( array( - 'amount' => 10, - 'discount_type' => 'percent', - 'exclude_sale_items' => false, - ) ); + $coupon_percent->set_props( + array( + 'amount' => 10, + 'discount_type' => 'percent', + 'exclude_sale_items' => false, + ) + ); $coupon_percent->save(); $coupon_percent_no_sale = new WC_Coupon(); - $coupon_percent_no_sale->set_props( array( - 'amount' => 10, - 'discount_type' => 'percent', - 'exclude_sale_items' => true, - ) ); + $coupon_percent_no_sale->set_props( + array( + 'amount' => 10, + 'discount_type' => 'percent', + 'exclude_sale_items' => true, + ) + ); $coupon_percent_no_sale->save(); WC()->cart->empty_cart(); @@ -1467,19 +1475,23 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { $product_sale->save(); $coupon_cart = new WC_Coupon(); - $coupon_cart->set_props( array( - 'amount' => 5, - 'discount_type' => 'fixed_cart', - 'exclude_sale_items' => false, - ) ); + $coupon_cart->set_props( + array( + 'amount' => 5, + 'discount_type' => 'fixed_cart', + 'exclude_sale_items' => false, + ) + ); $coupon_cart->save(); $coupon_cart_no_sale = new WC_Coupon(); - $coupon_cart_no_sale->set_props( array( - 'amount' => 5, - 'discount_type' => 'fixed_cart', - 'exclude_sale_items' => true, - ) ); + $coupon_cart_no_sale->set_props( + array( + 'amount' => 5, + 'discount_type' => 'fixed_cart', + 'exclude_sale_items' => true, + ) + ); $coupon_cart_no_sale->save(); WC()->cart->empty_cart(); @@ -1518,19 +1530,23 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case { $product_sale->save(); $coupon_product = new WC_Coupon(); - $coupon_product->set_props( array( - 'amount' => 5, - 'discount_type' => 'fixed_product', - 'exclude_sale_items' => false, - ) ); + $coupon_product->set_props( + array( + 'amount' => 5, + 'discount_type' => 'fixed_product', + 'exclude_sale_items' => false, + ) + ); $coupon_product->save(); $coupon_product_no_sale = new WC_Coupon(); - $coupon_product_no_sale->set_props( array( - 'amount' => 5, - 'discount_type' => 'fixed_product', - 'exclude_sale_items' => true, - ) ); + $coupon_product_no_sale->set_props( + array( + 'amount' => 5, + 'discount_type' => 'fixed_product', + 'exclude_sale_items' => true, + ) + ); $coupon_product_no_sale->save(); WC()->cart->empty_cart(); diff --git a/tests/unit-tests/gateways/paypal/request.php b/tests/unit-tests/gateways/paypal/request.php index 4bcb563db50..4b406397c8b 100644 --- a/tests/unit-tests/gateways/paypal/request.php +++ b/tests/unit-tests/gateways/paypal/request.php @@ -213,21 +213,21 @@ class WC_Tests_Paypal_Gateway_Request extends WC_Unit_Test_Case { $this->assertEquals( '_cart', $query_array['cmd'] ); $this->check_shipping_tax( $query_array, $shipping_tax_included ); - } - - /** - * Test removing HTML tags from product title and request URL - * - * @param bool $testmode Whether to use Paypal sandbox. - */ - protected function check_product_title_containing_html( $testmode ) { - $order = WC_Helper_Order::create_order(); + } - foreach ( $order->get_items() as $item ) { + /** + * Test removing HTML tags from product title and request URL + * + * @param bool $testmode Whether to use Paypal sandbox. + */ + protected function check_product_title_containing_html( $testmode ) { + $order = WC_Helper_Order::create_order(); + + foreach ( $order->get_items() as $item ) { $order->remove_item( $item->get_id() ); - } + } - $product = new WC_Product_Simple(); + $product = new WC_Product_Simple(); $product->set_props( array( 'name' => 'New Product Link', @@ -235,33 +235,35 @@ class WC_Tests_Paypal_Gateway_Request extends WC_Unit_Test_Case { 'price' => 10, ) ); - $product->save(); - $product = wc_get_product( $product->get_id() ); + $product->save(); + $product = wc_get_product( $product->get_id() ); - $qty = 1; - - $item = new WC_Order_Item_Product(); - $item->set_props( array( - 'product' => $product, - 'quantity' => $qty, - 'subtotal' => wc_get_price_excluding_tax( $product, array( 'qty' => $qty ) ), - 'total' => wc_get_price_excluding_tax( $product, array( 'qty' => $qty ) ), - ) ); - $item->save(); - - $order->add_item( $item ); - $order->save(); + $qty = 1; - $request_url = $this->paypal_request->get_request_url( $order, $testmode ); + $item = new WC_Order_Item_Product(); + $item->set_props( + array( + 'product' => $product, + 'quantity' => $qty, + 'subtotal' => wc_get_price_excluding_tax( $product, array( 'qty' => $qty ) ), + 'total' => wc_get_price_excluding_tax( $product, array( 'qty' => $qty ) ), + ) + ); + $item->save(); - $query_string = wp_parse_url( $request_url, PHP_URL_QUERY ) + $order->add_item( $item ); + $order->save(); + + $request_url = $this->paypal_request->get_request_url( $order, $testmode ); + + $query_string = wp_parse_url( $request_url, PHP_URL_QUERY ) ? wp_parse_url( $request_url, PHP_URL_QUERY ) - : ''; - $query_array = array(); - parse_str( $query_string, $query_array ); + : ''; + $query_array = array(); + parse_str( $query_string, $query_array ); - $this->assertEquals( $query_array['item_name_1'], 'New Product Link x ' . $qty ); - } + $this->assertEquals( $query_array['item_name_1'], 'New Product Link x ' . $qty ); + } /** * Return true if value is < 0, false otherwise. @@ -395,10 +397,10 @@ class WC_Tests_Paypal_Gateway_Request extends WC_Unit_Test_Case { // Test order with URL longer than limit. // Many items in order -> forced to use one line item -> shipping tax included. - $this->check_large_order( true, $testmode ); - - // Test removing tags from line item name - $this->check_product_title_containing_html( $testmode ); + $this->check_large_order( true, $testmode ); + + // Test removing tags from line item name + $this->check_product_title_containing_html( $testmode ); // Test amount < 0. $this->check_negative_amount( $testmode ); diff --git a/tests/unit-tests/importer/product.php b/tests/unit-tests/importer/product.php index bb3d408b048..2d06799fb5f 100644 --- a/tests/unit-tests/importer/product.php +++ b/tests/unit-tests/importer/product.php @@ -599,7 +599,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case { * * This function is called by WP_HTTP_TestCase::http_request_listner(). * - * @param array $request Request arguments. + * @param array $request Request arguments. * @param string $url URL of the request. * * @return array|false mocked response or false to let WP perform a regular request. diff --git a/tests/unit-tests/integrations/class-wc-tests-integrations.php b/tests/unit-tests/integrations/class-wc-tests-integrations.php index e11ec7054ed..083a873f11f 100644 --- a/tests/unit-tests/integrations/class-wc-tests-integrations.php +++ b/tests/unit-tests/integrations/class-wc-tests-integrations.php @@ -33,7 +33,7 @@ class WC_Tests_Integrations extends WC_Unit_Test_Case { $this->assertEquals( array(), $integrations->integrations ); $this->assertEquals( array(), $integrations->get_integrations() ); - require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-dummy-integration.php' ); + require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-dummy-integration.php'; add_filter( 'woocommerce_integrations', array( $this, 'add_dummy_integration' ) ); $integrations = new WC_Integrations(); diff --git a/tests/unit-tests/libraries/wp-background-process.php b/tests/unit-tests/libraries/wp-background-process.php index f57e01f6d47..bc762f1a307 100644 --- a/tests/unit-tests/libraries/wp-background-process.php +++ b/tests/unit-tests/libraries/wp-background-process.php @@ -18,12 +18,14 @@ class WC_Tests_Libraries_Background_Process extends WC_Unit_Test_Case { * @return void */ public function test_is_queue_empty() { - require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); + require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php'; $queue = new WC_Mock_Background_Process(); $this->assertEquals( true, $queue->is_queue_empty() ); - $queue->push_to_queue( array( - 'mock_key' => 'mock_value', - ) ); + $queue->push_to_queue( + array( + 'mock_key' => 'mock_value', + ) + ); $queue->save(); $this->assertEquals( false, $queue->is_queue_empty() ); } @@ -34,7 +36,7 @@ class WC_Tests_Libraries_Background_Process extends WC_Unit_Test_Case { * @return void */ public function test_schedule_cron_healthcheck() { - require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); + require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php'; $queue = new WC_Mock_Background_Process(); $this->assertArrayHasKey( 'wp_' . get_current_blog_id() . '_wc_mock_background_process_cron_interval', $queue->schedule_cron_healthcheck( array() ) ); } @@ -42,7 +44,7 @@ class WC_Tests_Libraries_Background_Process extends WC_Unit_Test_Case { * Test prefix & action against identifier. */ public function test_identifier() { - require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); + require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php'; $queue = new WC_Mock_Background_Process(); $this->assertEquals( 'wp_' . get_current_blog_id() . '_wc_mock_background_process', $queue->get_identifier() ); } @@ -53,11 +55,13 @@ class WC_Tests_Libraries_Background_Process extends WC_Unit_Test_Case { * @return void */ public function test_get_batch() { - require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php' ); + require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-wc-mock-background-process.php'; $queue = new WC_Mock_Background_Process(); - $queue->push_to_queue( array( - 'mock_key' => 'mock_value', - ) ); + $queue->push_to_queue( + array( + 'mock_key' => 'mock_value', + ) + ); $queue->save(); $this->assertNotEmpty( $queue->get_batch() ); } diff --git a/tests/unit-tests/log/log-handler-email.php b/tests/unit-tests/log/log-handler-email.php index fcfb0f8e227..d89da86bc88 100644 --- a/tests/unit-tests/log/log-handler-email.php +++ b/tests/unit-tests/log/log-handler-email.php @@ -23,8 +23,8 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_handle() { - $mailer = tests_retrieve_phpmailer_instance(); - $time = time(); + $mailer = tests_retrieve_phpmailer_instance(); + $time = time(); $site_name = get_bloginfo( 'name' ); $handler = new WC_Log_Handler_Email(); @@ -82,8 +82,8 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_email_subject() { - $mailer = tests_retrieve_phpmailer_instance(); - $time = time(); + $mailer = tests_retrieve_phpmailer_instance(); + $time = time(); $site_name = get_bloginfo( 'name' ); $handler = new WC_Log_Handler_Email( null, WC_Log_Levels::DEBUG ); @@ -114,10 +114,12 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { public function test_multiple_recipients() { $mailer = tests_retrieve_phpmailer_instance(); - $handler = new WC_Log_Handler_Email( array( - 'first@test.com', - 'Second Recipient ', - ) ); + $handler = new WC_Log_Handler_Email( + array( + 'first@test.com', + 'Second Recipient ', + ) + ); $handler->handle( time(), 'emergency', '', array() ); $handler->send_log_email(); @@ -141,7 +143,7 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { $handler->handle( time(), 'emergency', '', array() ); $handler->send_log_email(); - $recipient = $mailer->get_recipient( 'to' ); + $recipient = $mailer->get_recipient( 'to' ); $this->assertEquals( 'user@test.com', $recipient->address ); $this->assertEquals( 'User', $recipient->name ); } @@ -200,7 +202,7 @@ class WC_Tests_Log_Handler_Email extends WC_Unit_Test_Case { $mailer = tests_retrieve_phpmailer_instance(); $handler = new WC_Log_Handler_Email(); - $time = time(); + $time = time(); $handler->handle( $time, 'emergency', 'message 1', array() ); $handler->send_log_email(); $handler->handle( $time, 'emergency', 'message 2', array() ); diff --git a/tests/unit-tests/log/log-handler-file.php b/tests/unit-tests/log/log-handler-file.php index a6af09e52f4..c93c85dc981 100644 --- a/tests/unit-tests/log/log-handler-file.php +++ b/tests/unit-tests/log/log-handler-file.php @@ -47,10 +47,15 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { public function test_legacy_format() { $handler = new WC_Log_Handler_File( array( 'threshold' => 'debug' ) ); - $handler->handle( time(), 'info', 'this is a message', array( - 'source' => 'unit-tests', - '_legacy' => true, - ) ); + $handler->handle( + time(), + 'info', + 'this is a message', + array( + 'source' => 'unit-tests', + '_legacy' => true, + ) + ); $this->assertStringMatchesFormat( '%d-%d-%d @ %d:%d:%d - %s', $this->read_content( 'unit-tests' ) ); $this->assertStringEndsWith( ' - this is a message' . PHP_EOL, $this->read_content( 'unit-tests' ) ); @@ -62,7 +67,7 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_clear() { - $handler = new WC_Log_Handler_File(); + $handler = new WC_Log_Handler_File(); $log_name = '_test_clear'; $handler->handle( time(), 'debug', 'debug', array( 'source' => $log_name ) ); $handler->clear( $log_name ); @@ -75,7 +80,7 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_remove() { - $handler = new WC_Log_Handler_File(); + $handler = new WC_Log_Handler_File(); $log_name = '_test_remove'; $handler->handle( time(), 'debug', 'debug', array( 'source' => $log_name ) ); $handler->remove( wc_get_log_file_name( $log_name ) ); @@ -89,7 +94,7 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { */ public function test_writes_file() { $handler = new WC_Log_Handler_File(); - $time = time(); + $time = time(); $handler->handle( $time, 'debug', 'debug', array() ); $handler->handle( $time, 'info', 'info', array() ); @@ -110,8 +115,8 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_log_file_source() { - $handler = new WC_Log_Handler_File(); - $time = time(); + $handler = new WC_Log_Handler_File(); + $time = time(); $context_source = array( 'source' => 'unit-tests' ); $handler->handle( $time, 'debug', 'debug', $context_source ); @@ -133,9 +138,9 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_multiple_handlers() { - $handler_a = new WC_Log_Handler_File(); - $handler_b = new WC_Log_Handler_File(); - $time = time(); + $handler_a = new WC_Log_Handler_File(); + $handler_b = new WC_Log_Handler_File(); + $time = time(); $context_source = array( 'source' => 'unit-tests' ); // Different loggers should not conflict. @@ -162,9 +167,9 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { public function test_log_rotate() { // Handler with log size limit of 5mb - $handler = new WC_Log_Handler_File( 5 * 1024 * 1024 ); - $time = time(); - $log_name = '_test_log_rotate'; + $handler = new WC_Log_Handler_File( 5 * 1024 * 1024 ); + $time = time(); + $log_name = '_test_log_rotate'; $base_log_file = WC_Log_Handler_File::get_log_file_path( $log_name ); // Create log file larger than 5mb to ensure log is rotated @@ -199,9 +204,9 @@ class WC_Tests_Log_Handler_File extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_get_log_file_path() { - $log_dir = trailingslashit( WC_LOG_DIR ); + $log_dir = trailingslashit( WC_LOG_DIR ); $date_suffix = date( 'Y-m-d', current_time( 'timestamp', true ) ); - $hash_name = sanitize_file_name( wp_hash( 'unit-tests' ) ); + $hash_name = sanitize_file_name( wp_hash( 'unit-tests' ) ); $this->assertEquals( $log_dir . 'unit-tests-' . $date_suffix . '-' . $hash_name . '.log', WC_Log_Handler_File::get_log_file_path( 'unit-tests' ) ); } diff --git a/tests/unit-tests/log/log-levels.php b/tests/unit-tests/log/log-levels.php index da01cadf24a..df7953e63cd 100644 --- a/tests/unit-tests/log/log-levels.php +++ b/tests/unit-tests/log/log-levels.php @@ -13,7 +13,7 @@ class WC_Tests_Log_Levels extends WC_Unit_Test_Case { * @since 3.0.0 */ public function test_get_level_severity() { - $this->assertEquals( 0, WC_Log_Levels::get_level_severity( 'unrecognized level' ) ); + $this->assertEquals( 0, WC_Log_Levels::get_level_severity( 'unrecognized level' ) ); $this->assertEquals( 100, WC_Log_Levels::get_level_severity( 'debug' ) ); $this->assertEquals( 200, WC_Log_Levels::get_level_severity( 'info' ) ); $this->assertEquals( 300, WC_Log_Levels::get_level_severity( 'notice' ) ); diff --git a/tests/unit-tests/log/logger.php b/tests/unit-tests/log/logger.php index bad6551f11e..ac6930da466 100644 --- a/tests/unit-tests/log/logger.php +++ b/tests/unit-tests/log/logger.php @@ -13,7 +13,7 @@ class WC_Tests_Logger extends WC_Unit_Test_Case { * @since 2.4 */ public function test_add() { - $time = time(); + $time = time(); $handler = $this ->getMockBuilder( 'WC_Log_Handler_Interface' ) ->setMethods( array( 'handle' ) ) @@ -25,10 +25,12 @@ class WC_Tests_Logger extends WC_Unit_Test_Case { $this->greaterThanOrEqual( $time ), $this->equalTo( 'notice' ), $this->equalTo( 'this is a message' ), - $this->equalTo( array( - 'source' => 'unit-tests', - '_legacy' => true, - ) ) + $this->equalTo( + array( + 'source' => 'unit-tests', + '_legacy' => true, + ) + ) ); $log = new WC_Logger( array( $handler ), 'debug' ); @@ -66,7 +68,7 @@ class WC_Tests_Logger extends WC_Unit_Test_Case { */ public function test_log() { $handler = $this->create_mock_handler(); - $log = new WC_Logger( array( $handler ), 'debug' ); + $log = new WC_Logger( array( $handler ), 'debug' ); $log->log( 'debug', 'debug message' ); $log->log( 'info', 'info message' ); $log->log( 'notice', 'notice message' ); @@ -120,7 +122,7 @@ class WC_Tests_Logger extends WC_Unit_Test_Case { */ public function test_level_methods() { $handler = $this->create_mock_handler(); - $log = new WC_Logger( array( $handler ), 'debug' ); + $log = new WC_Logger( array( $handler ), 'debug' ); $log->debug( 'debug message' ); $log->info( 'info message' ); $log->notice( 'notice message' ); @@ -242,7 +244,7 @@ class WC_Tests_Logger extends WC_Unit_Test_Case { * @return WC_Log_Handler mock object */ public function create_mock_handler() { - $time = time(); + $time = time(); $handler = $this ->getMockBuilder( 'WC_Log_Handler_Interface' ) ->setMethods( array( 'handle' ) ) diff --git a/tests/unit-tests/order-items/class-wc-tests-order-item-product.php b/tests/unit-tests/order-items/class-wc-tests-order-item-product.php index 47501f98640..363dc16aaeb 100644 --- a/tests/unit-tests/order-items/class-wc-tests-order-item-product.php +++ b/tests/unit-tests/order-items/class-wc-tests-order-item-product.php @@ -146,10 +146,12 @@ class WC_Tests_Order_Item_Product extends WC_Unit_Test_Case { $variation_product = new WC_Product_Variation(); $variation_product->set_name( 'Test Variation' ); $variation_product->set_parent_id( $parent_product->get_id() ); - $variation_product->set_attributes( array( - 'color' => 'Green', - 'size' => 'Large', - ) ); + $variation_product->set_attributes( + array( + 'color' => 'Green', + 'size' => 'Large', + ) + ); $variation_product->save(); $product_item = new WC_Order_Item_Product(); @@ -158,7 +160,7 @@ class WC_Tests_Order_Item_Product extends WC_Unit_Test_Case { $product_item->save(); // Test with show_all on. - $formatted = $product_item->get_formatted_meta_data( '_', true ); + $formatted = $product_item->get_formatted_meta_data( '_', true ); $formatted_as_array = array(); foreach ( $formatted as $f ) { $formatted_as_array[] = (array) $f; @@ -188,7 +190,7 @@ class WC_Tests_Order_Item_Product extends WC_Unit_Test_Case { ); // Test with show_all off. - $formatted = $product_item->get_formatted_meta_data( '_', false ); + $formatted = $product_item->get_formatted_meta_data( '_', false ); $formatted_as_array = array(); foreach ( $formatted as $f ) { $formatted_as_array[] = (array) $f; @@ -267,7 +269,7 @@ class WC_Tests_Order_Item_Product extends WC_Unit_Test_Case { $this->assertTrue( isset( $item['item_meta_array'] ) ); $item['item_meta_array'] = array( 0 => (object) array( - 'key' => 'test', + 'key' => 'test', 'value' => 'val', ), ); diff --git a/tests/unit-tests/order-items/functions.php b/tests/unit-tests/order-items/functions.php index 1a3ba32f70e..3c391662cb6 100644 --- a/tests/unit-tests/order-items/functions.php +++ b/tests/unit-tests/order-items/functions.php @@ -22,10 +22,12 @@ class WC_Tests_Order_Item_Functions extends WC_Unit_Test_Case { $order = new WC_Order(); $item_1 = new WC_Order_Item_Product(); - $item_1->set_props( array( - 'product' => WC_Helper_Product::create_simple_product(), - 'quantity' => 4, - ) ); + $item_1->set_props( + array( + 'product' => WC_Helper_Product::create_simple_product(), + 'quantity' => 4, + ) + ); $order->add_item( $item_1 ); $order->save(); diff --git a/tests/unit-tests/order-items/order-item-coupon.php b/tests/unit-tests/order-items/order-item-coupon.php index 04c5d22cc92..113ec841216 100644 --- a/tests/unit-tests/order-items/order-item-coupon.php +++ b/tests/unit-tests/order-items/order-item-coupon.php @@ -13,7 +13,7 @@ class WC_Tests_Order_Item_Coupon extends WC_Unit_Test_Case { * @since 3.2.0 */ public function test_setters_getters() { - $coupon = new WC_Order_Item_Coupon; + $coupon = new WC_Order_Item_Coupon(); $coupon->set_name( 'testcoupon' ); $this->assertTrue( 'testcoupon' === $coupon->get_name() && $coupon->get_name() === $coupon->get_code() ); diff --git a/tests/unit-tests/order-items/order-item-tax.php b/tests/unit-tests/order-items/order-item-tax.php index 273bd9d1499..7eae039ad87 100644 --- a/tests/unit-tests/order-items/order-item-tax.php +++ b/tests/unit-tests/order-items/order-item-tax.php @@ -14,17 +14,17 @@ class WC_Tests_Order_Item_Tax extends WC_Unit_Test_Case { */ function test_set_get_tax_totals() { - $item = new WC_Order_Item_Tax; + $item = new WC_Order_Item_Tax(); $this->assertEquals( 0, $item->get_tax_total() ); - $item->set_tax_total( "1.50" ); - $this->assertEquals( "1.50", $item->get_tax_total() ); + $item->set_tax_total( '1.50' ); + $this->assertEquals( '1.50', $item->get_tax_total() ); - $item->set_tax_total( "" ); + $item->set_tax_total( '' ); $this->assertEquals( 0, $item->get_tax_total() ); $item->set_tax_total( 10.99 ); - $this->assertEquals( "10.99", $item->get_tax_total() ); + $this->assertEquals( '10.99', $item->get_tax_total() ); } /** @@ -34,16 +34,16 @@ class WC_Tests_Order_Item_Tax extends WC_Unit_Test_Case { */ function test_set_get_shipping_tax_totals() { - $item = new WC_Order_Item_Tax; + $item = new WC_Order_Item_Tax(); $this->assertEquals( 0, $item->get_shipping_tax_total() ); - $item->set_shipping_tax_total( "1.50" ); - $this->assertEquals( "1.50", $item->get_shipping_tax_total() ); + $item->set_shipping_tax_total( '1.50' ); + $this->assertEquals( '1.50', $item->get_shipping_tax_total() ); - $item->set_shipping_tax_total( "" ); + $item->set_shipping_tax_total( '' ); $this->assertEquals( 0, $item->get_shipping_tax_total() ); $item->set_shipping_tax_total( 10.99 ); - $this->assertEquals( "10.99", $item->get_shipping_tax_total() ); + $this->assertEquals( '10.99', $item->get_shipping_tax_total() ); } } diff --git a/tests/unit-tests/order/class-wc-tests-order-functions.php b/tests/unit-tests/order/class-wc-tests-order-functions.php index 51318ac4a9d..7b288c610c3 100644 --- a/tests/unit-tests/order/class-wc-tests-order-functions.php +++ b/tests/unit-tests/order/class-wc-tests-order-functions.php @@ -21,7 +21,8 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case { public function test_wc_get_order_statuses() { $order_statuses = apply_filters( - 'wc_order_statuses', array( + 'wc_order_statuses', + array( 'wc-pending' => _x( 'Pending payment', 'Order status', 'woocommerce' ), 'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ), 'wc-on-hold' => _x( 'On hold', 'Order status', 'woocommerce' ), diff --git a/tests/unit-tests/order/coupons.php b/tests/unit-tests/order/coupons.php index 94e2c2dfc16..cad9383045f 100644 --- a/tests/unit-tests/order/coupons.php +++ b/tests/unit-tests/order/coupons.php @@ -39,12 +39,14 @@ class WC_Tests_Order_Coupons extends WC_Unit_Test_Case { $coupon2->set_discount_type( 'percent' ); $coupon2->save(); - $order = wc_create_order( array( - 'status' => 'pending', - 'customer_id' => 1, - 'customer_note' => '', - 'total' => '', - ) ); + $order = wc_create_order( + array( + 'status' => 'pending', + 'customer_id' => 1, + 'customer_note' => '', + 'total' => '', + ) + ); // Add order products $product_item = new WC_Order_Item_Product(); @@ -52,39 +54,51 @@ class WC_Tests_Order_Coupons extends WC_Unit_Test_Case { $coupon_item_2 = new WC_Order_Item_Coupon(); if ( get_option( 'woocommerce_prices_include_tax', 'no' ) === 'yes' && get_option( 'woocommerce_calc_taxes', 'no' ) === 'yes' ) { - $product_item->set_props( array( - 'product' => $product, - 'quantity' => 1, - 'subtotal' => 909.09, // Ex tax. - 'total' => 726.36, - ) ); - $coupon_item_1->set_props( array( - 'code' => 'test-coupon-1', - 'discount' => 0.91, - 'discount_tax' => 0.09, - ) ); - $coupon_item_2->set_props( array( - 'code' => 'this-is-a-virtal-coupon', - 'discount' => 181.82, - 'discount_tax' => 18.18, - ) ); + $product_item->set_props( + array( + 'product' => $product, + 'quantity' => 1, + 'subtotal' => 909.09, // Ex tax. + 'total' => 726.36, + ) + ); + $coupon_item_1->set_props( + array( + 'code' => 'test-coupon-1', + 'discount' => 0.91, + 'discount_tax' => 0.09, + ) + ); + $coupon_item_2->set_props( + array( + 'code' => 'this-is-a-virtal-coupon', + 'discount' => 181.82, + 'discount_tax' => 18.18, + ) + ); } else { - $product_item->set_props( array( - 'product' => $product, - 'quantity' => 1, - 'subtotal' => 1000, // Ex tax. - 'total' => 799, - ) ); - $coupon_item_1->set_props( array( - 'code' => 'test-coupon-1', - 'discount' => 1, - 'discount_tax' => get_option( 'woocommerce_calc_taxes', 'no' ) === 'yes' ? 0.1 : 0, - ) ); - $coupon_item_2->set_props( array( - 'code' => 'this-is-a-virtal-coupon', - 'discount' => 200, - 'discount_tax' => get_option( 'woocommerce_calc_taxes', 'no' ) === 'yes' ? 20 : 0, - ) ); + $product_item->set_props( + array( + 'product' => $product, + 'quantity' => 1, + 'subtotal' => 1000, // Ex tax. + 'total' => 799, + ) + ); + $coupon_item_1->set_props( + array( + 'code' => 'test-coupon-1', + 'discount' => 1, + 'discount_tax' => get_option( 'woocommerce_calc_taxes', 'no' ) === 'yes' ? 0.1 : 0, + ) + ); + $coupon_item_2->set_props( + array( + 'code' => 'this-is-a-virtal-coupon', + 'discount' => 200, + 'discount_tax' => get_option( 'woocommerce_calc_taxes', 'no' ) === 'yes' ? 20 : 0, + ) + ); } $product_item->save(); @@ -99,17 +113,19 @@ class WC_Tests_Order_Coupons extends WC_Unit_Test_Case { $this->objects['coupons'][] = $coupon2; $this->objects['products'][] = $product; $this->objects['order'] = $order; - $this->objects['tax_rate_ids'][] = WC_Tax::_insert_tax_rate( array( - 'tax_rate_country' => '', - 'tax_rate_state' => '', - 'tax_rate' => '10.0000', - 'tax_rate_name' => 'VAT', - 'tax_rate_priority' => '1', - 'tax_rate_compound' => '0', - 'tax_rate_shipping' => '1', - 'tax_rate_order' => '1', - 'tax_rate_class' => '', - ) ); + $this->objects['tax_rate_ids'][] = WC_Tax::_insert_tax_rate( + array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '10.0000', + 'tax_rate_name' => 'VAT', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '', + ) + ); $order->calculate_totals( true ); $order->save(); diff --git a/tests/unit-tests/order/query.php b/tests/unit-tests/order/query.php index efc2325306a..fb12f11e3cc 100644 --- a/tests/unit-tests/order/query.php +++ b/tests/unit-tests/order/query.php @@ -34,7 +34,7 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $order2->save(); // Just get some orders. - $query = new WC_Order_Query(); + $query = new WC_Order_Query(); $results = $query->get_orders(); $this->assertEquals( 2, count( $results ) ); @@ -67,45 +67,53 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { * @since 3.1 */ public function test_order_query_date_queries() { - $now = current_time( 'mysql', true ); - $now_stamp = strtotime( $now ); - $now_date = date( 'Y-m-d', $now_stamp ); - $past_stamp = $now_stamp - DAY_IN_SECONDS; - $past = date( 'Y-m-d', $past_stamp ); + $now = current_time( 'mysql', true ); + $now_stamp = strtotime( $now ); + $now_date = date( 'Y-m-d', $now_stamp ); + $past_stamp = $now_stamp - DAY_IN_SECONDS; + $past = date( 'Y-m-d', $past_stamp ); $future_stamp = $now_stamp + DAY_IN_SECONDS; - $future = date( 'Y-m-d', $future_stamp ); + $future = date( 'Y-m-d', $future_stamp ); $order = new WC_Order(); $order->set_date_completed( $now_stamp ); $order->save(); // Check WC_DateTime support. - $query = new WC_Order_Query( array( - 'date_created' => $order->get_date_created(), - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => $order->get_date_created(), + ) + ); $orders = $query->get_orders(); $this->assertEquals( 1, count( $orders ) ); // Check date support. - $query = new WC_Order_Query( array( - 'date_created' => $now_date, - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => $now_date, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', $past ); $this->assertEquals( 0, count( $query->get_orders() ) ); // Check timestamp support. - $query = new WC_Order_Query( array( - 'date_created' => $order->get_date_created()->getTimestamp(), - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => $order->get_date_created()->getTimestamp(), + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', $future_stamp ); $this->assertEquals( 0, count( $query->get_orders() ) ); // Check comparison support. - $query = new WC_Order_Query( array( - 'date_created' => '>' . $past, - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => '>' . $past, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', '<' . $past ); $this->assertEquals( 0, count( $query->get_orders() ) ); @@ -113,18 +121,22 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $this->assertEquals( 1, count( $query->get_orders() ) ); // Check timestamp comparison support. - $query = new WC_Order_Query( array( - 'date_created' => '<' . $future_stamp, - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => '<' . $future_stamp, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', '<' . $past_stamp ); $this->assertEquals( 0, count( $query->get_orders() ) ); $query->set( 'date_created', '>=' . $now_stamp ); // Check date range support. - $query = new WC_Order_Query( array( - 'date_created' => $past . '...' . $future, - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => $past . '...' . $future, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', $past . '...' . $now_date ); $this->assertEquals( 1, count( $query->get_orders() ) ); @@ -132,9 +144,11 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $this->assertEquals( 0, count( $query->get_orders() ) ); // Check timestamp range support. - $query = new WC_Order_Query( array( - 'date_created' => $past_stamp . '...' . $future_stamp, - ) ); + $query = new WC_Order_Query( + array( + 'date_created' => $past_stamp . '...' . $future_stamp, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_created', $now_stamp . '...' . $future_stamp ); $this->assertEquals( 1, count( $query->get_orders() ) ); @@ -148,45 +162,53 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { * @since 3.1 */ public function test_order_query_meta_date_queries() { - $now = current_time( 'mysql', true ); - $now_stamp = strtotime( $now ); - $now_date = date( 'Y-m-d', $now_stamp ); - $past_stamp = $now_stamp - DAY_IN_SECONDS; - $past = date( 'Y-m-d', $past_stamp ); + $now = current_time( 'mysql', true ); + $now_stamp = strtotime( $now ); + $now_date = date( 'Y-m-d', $now_stamp ); + $past_stamp = $now_stamp - DAY_IN_SECONDS; + $past = date( 'Y-m-d', $past_stamp ); $future_stamp = $now_stamp + DAY_IN_SECONDS; - $future = date( 'Y-m-d', $future_stamp ); + $future = date( 'Y-m-d', $future_stamp ); $order = new WC_Order(); $order->set_date_completed( $now_stamp ); $order->save(); // Check WC_DateTime support. - $query = new WC_Order_Query( array( - 'date_completed' => $order->get_date_completed(), - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => $order->get_date_completed(), + ) + ); $orders = $query->get_orders(); $this->assertEquals( 1, count( $orders ) ); // Check date support. - $query = new WC_Order_Query( array( - 'date_completed' => $now_date, - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => $now_date, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', $past ); $this->assertEquals( 0, count( $query->get_orders() ) ); // Check timestamp support. - $query = new WC_Order_Query( array( - 'date_completed' => $order->get_date_completed()->getTimestamp(), - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => $order->get_date_completed()->getTimestamp(), + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', $future_stamp ); $this->assertEquals( 0, count( $query->get_orders() ) ); // Check comparison support. - $query = new WC_Order_Query( array( - 'date_completed' => '>' . $past, - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => '>' . $past, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', '<' . $past ); $this->assertEquals( 0, count( $query->get_orders() ) ); @@ -194,18 +216,22 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $this->assertEquals( 1, count( $query->get_orders() ) ); // Check timestamp comparison support. - $query = new WC_Order_Query( array( - 'date_completed' => '<' . $future_stamp, - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => '<' . $future_stamp, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', '<' . $past_stamp ); $this->assertEquals( 0, count( $query->get_orders() ) ); $query->set( 'date_completed', '>=' . $now_stamp ); // Check date range support. - $query = new WC_Order_Query( array( - 'date_completed' => $past . '...' . $future, - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => $past . '...' . $future, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', $now_date . '...' . $future ); $this->assertEquals( 1, count( $query->get_orders() ) ); @@ -213,9 +239,11 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $this->assertEquals( 0, count( $query->get_orders() ) ); // Check timestamp range support. - $query = new WC_Order_Query( array( - 'date_completed' => $past_stamp . '...' . $future_stamp, - ) ); + $query = new WC_Order_Query( + array( + 'date_completed' => $past_stamp . '...' . $future_stamp, + ) + ); $this->assertEquals( 1, count( $query->get_orders() ) ); $query->set( 'date_completed', $now_stamp . '...' . $future_stamp ); $this->assertEquals( 1, count( $query->get_orders() ) ); @@ -229,19 +257,23 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { * @since 3.1 */ public function test_order_query_key_mapping() { - $user_id = wp_insert_user( array( - 'user_login' => 'testname', - 'user_pass' => 'testpass', - 'user_email' => 'email@testmail.com', - ) ); + $user_id = wp_insert_user( + array( + 'user_login' => 'testname', + 'user_pass' => 'testpass', + 'user_email' => 'email@testmail.com', + ) + ); $order = new WC_Order(); $order->set_customer_id( $user_id ); $order->save(); - $query = new WC_Order_Query( array( - 'customer_id' => $user_id, - ) ); + $query = new WC_Order_Query( + array( + 'customer_id' => $user_id, + ) + ); $results = $query->get_orders(); $this->assertEquals( 1, count( $results ) ); @@ -249,18 +281,22 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { public function test_order_query_search_by_customers() { $user_email_1 = 'email@testmail.com'; - $user_id_1 = wp_insert_user( array( - 'user_login' => 'testname', - 'user_pass' => 'testpass', - 'user_email' => $user_email_1, - ) ); + $user_id_1 = wp_insert_user( + array( + 'user_login' => 'testname', + 'user_pass' => 'testpass', + 'user_email' => $user_email_1, + ) + ); $user_email_2 = 'email2@testmail.com'; - $user_id_2 = wp_insert_user( array( - 'user_login' => 'testname2', - 'user_pass' => 'testpass2', - 'user_email' => $user_email_2, - ) ); + $user_id_2 = wp_insert_user( + array( + 'user_login' => 'testname2', + 'user_pass' => 'testpass2', + 'user_email' => $user_email_2, + ) + ); $order1 = new WC_Order(); $order1->set_customer_id( $user_id_1 ); @@ -275,30 +311,38 @@ class WC_Tests_WC_Order_Query extends WC_Unit_Test_Case { $order3->save(); // Searching for both users IDs should return all orders. - $query = new WC_Order_Query( array( - 'customer' => array( $user_id_1, $user_id_2 ), - ) ); + $query = new WC_Order_Query( + array( + 'customer' => array( $user_id_1, $user_id_2 ), + ) + ); $results = $query->get_orders(); $this->assertEquals( 3, count( $results ) ); // Searching for user 1 email and user 2 ID should return all orders. - $query = new WC_Order_Query( array( - 'customer' => array( $user_email_1, $user_id_2 ), - ) ); + $query = new WC_Order_Query( + array( + 'customer' => array( $user_email_1, $user_id_2 ), + ) + ); $results = $query->get_orders(); $this->assertEquals( 3, count( $results ) ); // Searching for orders that match the first user email AND ID should return only a single order - $query = new WC_Order_Query( array( - 'customer' => array( array( $user_email_1, $user_id_1 ) ), - ) ); + $query = new WC_Order_Query( + array( + 'customer' => array( array( $user_email_1, $user_id_1 ) ), + ) + ); $results = $query->get_orders(); $this->assertEquals( 1, count( $results ) ); // Searching for orders that match the first user email AND the second user ID should return no orders. - $query = new WC_Order_Query( array( - 'customer' => array( array( $user_email_1, $user_id_2 ) ), - ) ); + $query = new WC_Order_Query( + array( + 'customer' => array( array( $user_email_1, $user_id_2 ) ), + ) + ); $results = $query->get_orders(); $this->assertEquals( 0, count( $results ) ); } diff --git a/tests/unit-tests/payment-tokens/cc.php b/tests/unit-tests/payment-tokens/cc.php index b8c43390acc..44209f4ffa0 100644 --- a/tests/unit-tests/payment-tokens/cc.php +++ b/tests/unit-tests/payment-tokens/cc.php @@ -90,8 +90,8 @@ class WC_Tests_Payment_Token_CC extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_payment_token_cc_read_pulls_meta() { - $token = WC_Helper_Payment_Token::create_cc_token(); - $token_id = $token->get_id(); + $token = WC_Helper_Payment_Token::create_cc_token(); + $token_id = $token->get_id(); $token_read = new WC_Payment_Token_CC( $token_id ); $this->assertEquals( '1234', $token_read->get_last4() ); } diff --git a/tests/unit-tests/payment-tokens/echeck.php b/tests/unit-tests/payment-tokens/echeck.php index fe099a9ff36..7ce0e20e7a1 100644 --- a/tests/unit-tests/payment-tokens/echeck.php +++ b/tests/unit-tests/payment-tokens/echeck.php @@ -33,7 +33,7 @@ class WC_Tests_Payment_Token_eCheck extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_payment_token_echeck_read_pulls_meta() { - $token = WC_Helper_Payment_Token::create_eCheck_token(); + $token = WC_Helper_Payment_Token::create_eCheck_token(); $token_id = $token->get_id(); $token_read = new WC_Payment_Token_ECheck( $token_id ); diff --git a/tests/unit-tests/payment-tokens/payment-token.php b/tests/unit-tests/payment-tokens/payment-token.php index c8daf54f1d8..ad711c35a8e 100644 --- a/tests/unit-tests/payment-tokens/payment-token.php +++ b/tests/unit-tests/payment-tokens/payment-token.php @@ -20,7 +20,7 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case { */ public function test_wc_payment_token_token() { $raw_token = time() . ' ' . __FUNCTION__; - $token = new WC_Payment_Token_Stub(); + $token = new WC_Payment_Token_Stub(); $token->set_token( $raw_token ); $this->assertEquals( $raw_token, $token->get_token() ); } @@ -73,7 +73,7 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case { */ public function test_wc_payment_token_get_data() { $raw_token = time() . ' ' . __FUNCTION__; - $token = new WC_Payment_Token_Stub(); + $token = new WC_Payment_Token_Stub(); $token->set_token( $raw_token ); $token->set_gateway_id( 'paypal' ); $token->set_extra( 'woocommerce' ); @@ -105,7 +105,7 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_payment_token_read() { - $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); + $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); $token_id = $token->get_id(); $token_read = new WC_Payment_Token_Stub( $token_id ); @@ -150,7 +150,7 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case { * @since 2.6.0 */ public function test_wc_payment_token_delete() { - $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); + $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); $token_id = $token->get_id(); $token->delete(); $get_token = WC_Payment_Tokens::get( $token_id ); @@ -176,7 +176,7 @@ class WC_Tests_Payment_Token extends WC_Unit_Test_Case { * @expectedDeprecated WC_Payment_Token::update */ public function test_wc_payment_token_legacy() { - $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); + $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); $token_id = $token->get_id(); $token_read = new WC_Payment_Token_Stub(); diff --git a/tests/unit-tests/payment-tokens/payment-tokens.php b/tests/unit-tests/payment-tokens/payment-tokens.php index 850d3f2ebad..845f1c9d3c6 100644 --- a/tests/unit-tests/payment-tokens/payment-tokens.php +++ b/tests/unit-tests/payment-tokens/payment-tokens.php @@ -119,8 +119,8 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { * @since 2.6.0 */ function test_wc_payment_tokens_get() { - $token = WC_Helper_Payment_Token::create_cc_token(); - $token_id = $token->get_id(); + $token = WC_Helper_Payment_Token::create_cc_token(); + $token_id = $token->get_id(); $get_token = WC_Payment_Tokens::get( $token_id ); $this->assertEquals( $token->get_token(), $get_token->get_token() ); } @@ -130,7 +130,7 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { * @since 2.6.0 */ function test_wc_payment_tokens_delete() { - $token = WC_Helper_Payment_Token::create_cc_token(); + $token = WC_Helper_Payment_Token::create_cc_token(); $token_id = $token->get_id(); WC_Payment_Tokens::delete( $token_id ); @@ -144,7 +144,7 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { * @since 2.6.0 */ function test_wc_payment_tokens_get_type_by_id() { - $token = WC_Helper_Payment_Token::create_cc_token(); + $token = WC_Helper_Payment_Token::create_cc_token(); $token_id = $token->get_id(); $this->assertEquals( 'CC', WC_Payment_Tokens::get_token_type_by_id( $token_id ) ); } @@ -154,11 +154,11 @@ class WC_Tests_Payment_Tokens extends WC_Unit_Test_Case { * @since 2.6.0 */ function test_wc_payment_tokens_set_users_default() { - $token = WC_Helper_Payment_Token::create_cc_token( $this->user_id ); + $token = WC_Helper_Payment_Token::create_cc_token( $this->user_id ); $token_id = $token->get_id(); $token->save(); - $token2 = WC_Helper_Payment_Token::create_cc_token( $this->user_id ); + $token2 = WC_Helper_Payment_Token::create_cc_token( $this->user_id ); $token_id_2 = $token2->get_id(); $token2->save(); diff --git a/tests/unit-tests/product/data.php b/tests/unit-tests/product/data.php index cedce35c997..86544dfe7b9 100644 --- a/tests/unit-tests/product/data.php +++ b/tests/unit-tests/product/data.php @@ -273,7 +273,7 @@ class WC_Tests_Product_Data extends WC_Unit_Test_Case { * Test: test_get_image_should_return_product_image. */ public function test_get_image_should_return_product_image() { - $product = new WC_Product(); + $product = new WC_Product(); $image_url = $this->set_product_image( $product ); $this->assertEquals( @@ -297,9 +297,9 @@ class WC_Tests_Product_Data extends WC_Unit_Test_Case { */ public function test_get_image_should_return_parent_product_image() { $variable_product = WC_Helper_Product::create_variation_product(); - $variations = $variable_product->get_children(); - $variation_1 = wc_get_product( $variations[0] ); - $image_url = $this->set_product_image( $variable_product ); + $variations = $variable_product->get_children(); + $variation_1 = wc_get_product( $variations[0] ); + $image_url = $this->set_product_image( $variable_product ); $this->assertEquals( '', diff --git a/tests/unit-tests/product/factory.php b/tests/unit-tests/product/factory.php index f273af18995..77efc75498c 100644 --- a/tests/unit-tests/product/factory.php +++ b/tests/unit-tests/product/factory.php @@ -12,9 +12,9 @@ class WC_Tests_Product_Factory extends WC_Unit_Test_Case { * @since 3.0.0 */ function test_get_product_type() { - $simple = WC_Helper_Product::create_simple_product(); + $simple = WC_Helper_Product::create_simple_product(); $external = WC_Helper_Product::create_external_product(); - $grouped = WC_Helper_Product::create_grouped_product(); + $grouped = WC_Helper_Product::create_grouped_product(); $variable = WC_Helper_Product::create_variation_product(); $children = $variable->get_children(); $child_id = $children[0]; @@ -51,7 +51,7 @@ class WC_Tests_Product_Factory extends WC_Unit_Test_Case { */ function test_get_product() { $test_product = WC_Helper_Product::create_simple_product(); - $get_product = WC()->product_factory->get_product( $test_product->get_id() ); + $get_product = WC()->product_factory->get_product( $test_product->get_id() ); $this->assertEquals( $test_product->get_data(), $get_product->get_data() ); } diff --git a/tests/unit-tests/product/product-variation.php b/tests/unit-tests/product/product-variation.php index c3ec6af5683..4887d46ea13 100644 --- a/tests/unit-tests/product/product-variation.php +++ b/tests/unit-tests/product/product-variation.php @@ -19,11 +19,11 @@ class WC_Tests_Product_Variation extends WC_Unit_Test_Case { */ public function test_is_sold_individually() { // Create a variable product with sold individually. - $product = new WC_Product_Variable; + $product = new WC_Product_Variable(); $product->set_sold_individually( true ); $product->save(); - $variation = new WC_Product_Variation; + $variation = new WC_Product_Variation(); $variation->set_parent_id( $product->get_id() ); $variation->save(); @@ -35,11 +35,11 @@ class WC_Tests_Product_Variation extends WC_Unit_Test_Case { * Check get_tax_class against different parent child scenarios */ public function test_get_tax_class() { - $product = new WC_Product_Variable; + $product = new WC_Product_Variable(); $product->set_tax_class( 'standard' ); $product->save(); - $variation = new WC_Product_Variation; + $variation = new WC_Product_Variation(); $variation->set_parent_id( $product->get_id() ); $variation->set_tax_class( 'parent' ); $variation->save(); diff --git a/tests/unit-tests/session/class-wc-tests-session-handler.php b/tests/unit-tests/session/class-wc-tests-session-handler.php index d4fbe18165f..4149f90fbb6 100644 --- a/tests/unit-tests/session/class-wc-tests-session-handler.php +++ b/tests/unit-tests/session/class-wc-tests-session-handler.php @@ -62,7 +62,7 @@ class WC_Tests_Session_Handler extends WC_Unit_Test_Case { public function test_get_session_should_return_default_value() { $default_session = array( 'session' => 'default' ); - $session = $this->handler->get_session( 'non-existent key', $default_session ); + $session = $this->handler->get_session( 'non-existent key', $default_session ); $this->assertEquals( $default_session, $session ); } @@ -106,7 +106,7 @@ class WC_Tests_Session_Handler extends WC_Unit_Test_Case { wp_set_current_user( 1 ); $this->handler->set( 'cart', 'fake cart' ); $this->handler->save_data(); - $this->session_key = $this->handler->get_customer_id(); + $this->session_key = $this->handler->get_customer_id(); $this->cache_prefix = WC_Cache_Helper::get_cache_prefix( WC_SESSION_CACHE_GROUP ); } diff --git a/tests/unit-tests/settings/register-wp-admin-settings.php b/tests/unit-tests/settings/register-wp-admin-settings.php index 156f8dd5963..3f79d8ae76e 100644 --- a/tests/unit-tests/settings/register-wp-admin-settings.php +++ b/tests/unit-tests/settings/register-wp-admin-settings.php @@ -67,7 +67,7 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case { 'label' => $this->page->get_label(), ), ); - $actual = $settings->register_page_group( $initial ); + $actual = $settings->register_page_group( $initial ); $this->assertEquals( $expected, $actual ); } @@ -109,11 +109,11 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case { // Boolean 'desc_tip' defaulting to 'desc' value array( array( - 'id' => 'setting-id', - 'type' => 'select', - 'title' => 'Setting Name', - 'desc' => 'Setting Description', - 'desc_tip' => true, + 'id' => 'setting-id', + 'type' => 'select', + 'title' => 'Setting Name', + 'desc' => 'Setting Description', + 'desc_tip' => true, 'option_key' => '', ), array( @@ -211,18 +211,18 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case { $settings = array( array( - 'id' => 'setting-1', - 'type' => 'text', - 'option_key' => '', + 'id' => 'setting-1', + 'type' => 'text', + 'option_key' => '', ), array( - 'type' => 'no-id', - 'option_key' => '', + 'type' => 'no-id', + 'option_key' => '', ), array( - 'id' => 'setting-2', - 'type' => 'textarea', - 'option_key' => '', + 'id' => 'setting-2', + 'type' => 'textarea', + 'option_key' => '', ), ); @@ -249,7 +249,7 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case { 'option_key' => 'setting-2', ), ); - $actual = $settings->register_page_settings( array() ); + $actual = $settings->register_page_settings( array() ); $this->assertEquals( $expected, $actual ); } diff --git a/tests/unit-tests/setup/functions.php b/tests/unit-tests/setup/functions.php index 9612ab8cced..9167b97bb16 100644 --- a/tests/unit-tests/setup/functions.php +++ b/tests/unit-tests/setup/functions.php @@ -25,45 +25,63 @@ class WC_Tests_Setup_Functions extends WC_Unit_Test_Case { // non-admin user $this->user_id = $this->factory->user->create( array( 'role' => 'shop_manager' ) ); wp_set_current_user( $this->user_id ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'paypal' => false, - ) ); + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'paypal' => false, + ) + ); // set admin user $this->user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); wp_set_current_user( $this->user_id ); update_option( 'woocommerce_default_country', 'US' ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'stripe' => true, - 'ppec_paypal' => true, - ) ); + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'stripe' => true, + 'ppec_paypal' => true, + ) + ); update_option( 'woocommerce_default_country', 'CN' ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'ppec_paypal' => true, - ) ); + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'ppec_paypal' => true, + ) + ); update_option( 'woocommerce_default_country', 'SE' ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'klarna_checkout' => true, - 'ppec_paypal' => true, - 'stripe' => false, - ) ); + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'klarna_checkout' => true, + 'ppec_paypal' => true, + 'stripe' => false, + ) + ); update_option( 'woocommerce_default_country', 'DE' ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'klarna_payments' => true, - 'ppec_paypal' => true, - 'stripe' => false, - ) ); + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'klarna_payments' => true, + 'ppec_paypal' => true, + 'stripe' => false, + ) + ); update_option( 'woocommerce_default_country', 'GB' ); update_option( 'woocommerce_sell_in_person', 'yes' ); - $this->assertEquals( gateways( $setup_wizard ), array( - 'square' => true, - 'ppec_paypal' => true, - 'stripe' => false, - ) ); - } + $this->assertEquals( + gateways( $setup_wizard ), + array( + 'square' => true, + 'ppec_paypal' => true, + 'stripe' => false, + ) + ); + } } diff --git a/tests/unit-tests/shortcodes/products.php b/tests/unit-tests/shortcodes/products.php index f72453a2889..71b1088eca5 100644 --- a/tests/unit-tests/shortcodes/products.php +++ b/tests/unit-tests/shortcodes/products.php @@ -34,10 +34,12 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { ); $this->assertEquals( $expected, $shortcode->get_attributes() ); - $shortcode2 = new WC_Shortcode_Products( array( - 'orderby' => 'id', - 'order' => 'DESC', - ) ); + $shortcode2 = new WC_Shortcode_Products( + array( + 'orderby' => 'id', + 'order' => 'DESC', + ) + ); $expected2 = array( 'limit' => '-1', 'columns' => '4', @@ -85,10 +87,12 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected, $shortcode->get_query_args() ); // products shortcode with attributes. - $shortcode2 = new WC_Shortcode_Products( array( - 'orderby' => 'ID', - 'order' => 'DESC', - ) ); + $shortcode2 = new WC_Shortcode_Products( + array( + 'orderby' => 'ID', + 'order' => 'DESC', + ) + ); $expected2 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -103,11 +107,13 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { ); $this->assertEquals( $expected2, $shortcode2->get_query_args() ); - $shortcode3 = new WC_Shortcode_Products( array( - 'ids' => '1,2,3', - 'skus' => 'foo,bar', - ) ); - $expected3 = array( + $shortcode3 = new WC_Shortcode_Products( + array( + 'ids' => '1,2,3', + 'skus' => 'foo,bar', + ) + ); + $expected3 = array( 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => true, @@ -129,15 +135,18 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected3, $shortcode3->get_query_args() ); // product_category shortcode. - $shortcode4 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'ASC', - 'category' => 'clothing', - 'operator' => 'IN', - ), 'product_category' ); - $expected4 = array( + $shortcode4 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'ASC', + 'category' => 'clothing', + 'operator' => 'IN', + ), + 'product_category' + ); + $expected4 = array( 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => true, @@ -160,15 +169,18 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected4, $shortcode4->get_query_args() ); // product_category shortcode using category ids. - $shortcode4_id = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'ASC', - 'category' => '123', - 'operator' => 'IN', - ), 'product_category' ); - $expected4_id = array( + $shortcode4_id = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'ASC', + 'category' => '123', + 'operator' => 'IN', + ), + 'product_category' + ); + $expected4_id = array( 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => true, @@ -191,14 +203,17 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected4_id, $shortcode4_id->get_query_args() ); // recent_products shortcode. - $shortcode5 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'date', - 'order' => 'DESC', - 'category' => '', - 'operator' => 'IN', - ), 'recent_products' ); + $shortcode5 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'date', + 'order' => 'DESC', + 'category' => '', + 'operator' => 'IN', + ), + 'recent_products' + ); $expected5 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -215,10 +230,13 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected5, $shortcode5->get_query_args() ); // product shortcode. - $shortcode6 = new WC_Shortcode_Products( array( - 'ids' => '1', - 'per_page' => '1', - ), 'product' ); + $shortcode6 = new WC_Shortcode_Products( + array( + 'ids' => '1', + 'per_page' => '1', + ), + 'product' + ); $expected6 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -236,14 +254,17 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected6, $shortcode6->get_query_args() ); // sale_products shortcode. - $shortcode7 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'ASC', - 'category' => '', - 'operator' => 'IN', - ), 'sale_products' ); + $shortcode7 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'ASC', + 'category' => '', + 'operator' => 'IN', + ), + 'sale_products' + ); $expected7 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -261,12 +282,15 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected7, $shortcode7->get_query_args() ); // best_selling_products shortcode. - $shortcode8 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'category' => '', - 'operator' => 'IN', - ), 'best_selling_products' ); + $shortcode8 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'category' => '', + 'operator' => 'IN', + ), + 'best_selling_products' + ); $expected8 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -284,14 +308,17 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected8, $shortcode8->get_query_args() ); // top_rated_products shortcode. - $shortcode9 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'ASC', - 'category' => '', - 'operator' => 'IN', - ), 'top_rated_products' ); + $shortcode9 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'ASC', + 'category' => '', + 'operator' => 'IN', + ), + 'top_rated_products' + ); $expected9 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -308,15 +335,17 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected9, $shortcode9->get_query_args() ); // featured_products shortcode. - $shortcode10 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'date', - 'order' => 'DESC', - 'category' => '', - 'operator' => 'IN', - 'visibility' => 'featured', - ) ); + $shortcode10 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'date', + 'order' => 'DESC', + 'category' => '', + 'operator' => 'IN', + 'visibility' => 'featured', + ) + ); $expected10 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -326,29 +355,35 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'order' => 'DESC', 'posts_per_page' => 12, 'meta_query' => $meta_query, - 'tax_query' => array_merge( $tax_query, array( + 'tax_query' => array_merge( + $tax_query, array( - 'taxonomy' => 'product_visibility', - 'terms' => 'featured', - 'field' => 'name', - 'operator' => 'IN', - 'include_children' => false, - ), - ) ), + array( + 'taxonomy' => 'product_visibility', + 'terms' => 'featured', + 'field' => 'name', + 'operator' => 'IN', + 'include_children' => false, + ), + ) + ), 'fields' => 'ids', ); $this->assertEquals( $expected10, $shortcode10->get_query_args() ); // product_attribute shortcode. - $shortcode11 = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'asc', - 'attribute' => 'color', - 'filter' => 'black', - ), 'product_attribute' ); + $shortcode11 = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'asc', + 'attribute' => 'color', + 'filter' => 'black', + ), + 'product_attribute' + ); $expected11 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -358,28 +393,34 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'order' => 'ASC', 'posts_per_page' => 12, 'meta_query' => $meta_query, - 'tax_query' => array_merge( $tax_query, array( + 'tax_query' => array_merge( + $tax_query, array( - 'taxonomy' => 'pa_color', - 'terms' => array( 'black' ), - 'field' => 'slug', - 'operator' => 'IN', - ), - ) ), + array( + 'taxonomy' => 'pa_color', + 'terms' => array( 'black' ), + 'field' => 'slug', + 'operator' => 'IN', + ), + ) + ), 'fields' => 'ids', ); $this->assertEquals( $expected11, $shortcode11->get_query_args() ); // product_attribute shortcode using term ids. - $shortcode11_id = new WC_Shortcode_Products( array( - 'per_page' => '12', - 'columns' => '4', - 'orderby' => 'title', - 'order' => 'asc', - 'attribute' => 'color', - 'terms' => '123', - ), 'product_attribute' ); + $shortcode11_id = new WC_Shortcode_Products( + array( + 'per_page' => '12', + 'columns' => '4', + 'orderby' => 'title', + 'order' => 'asc', + 'attribute' => 'color', + 'terms' => '123', + ), + 'product_attribute' + ); $expected11_id = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -389,23 +430,28 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'order' => 'ASC', 'posts_per_page' => 12, 'meta_query' => $meta_query, - 'tax_query' => array_merge( $tax_query, array( + 'tax_query' => array_merge( + $tax_query, array( - 'taxonomy' => 'pa_color', - 'terms' => array( 123 ), - 'field' => 'term_id', - 'operator' => 'IN', - ), - ) ), + array( + 'taxonomy' => 'pa_color', + 'terms' => array( 123 ), + 'field' => 'term_id', + 'operator' => 'IN', + ), + ) + ), 'fields' => 'ids', ); $this->assertEquals( $expected11_id, $shortcode11_id->get_query_args() ); // Check for visibility shortcode. - $shortcode12 = new WC_Shortcode_Products( array( - 'visibility' => 'hidden', - ) ); + $shortcode12 = new WC_Shortcode_Products( + array( + 'visibility' => 'hidden', + ) + ); $expected12 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -429,9 +475,11 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected12, $shortcode12->get_query_args() ); - $shortcode13 = new WC_Shortcode_Products( array( - 'visibility' => 'catalog', - ) ); + $shortcode13 = new WC_Shortcode_Products( + array( + 'visibility' => 'catalog', + ) + ); $expected13 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -462,9 +510,11 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected13, $shortcode13->get_query_args() ); - $shortcode14 = new WC_Shortcode_Products( array( - 'visibility' => 'search', - ) ); + $shortcode14 = new WC_Shortcode_Products( + array( + 'visibility' => 'search', + ) + ); $expected14 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -496,10 +546,12 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $this->assertEquals( $expected14, $shortcode14->get_query_args() ); // products shortcode -- select multiple categories using AND operator. - $shortcode15 = new WC_Shortcode_Products( array( - 'category' => 'cat1,cat2', - 'cat_operator' => 'AND', - ) ); + $shortcode15 = new WC_Shortcode_Products( + array( + 'category' => 'cat1,cat2', + 'cat_operator' => 'AND', + ) + ); $expected15 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -509,25 +561,30 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'order' => 'ASC', 'posts_per_page' => -1, 'meta_query' => $meta_query, - 'tax_query' => array_merge( $tax_query, array( + 'tax_query' => array_merge( + $tax_query, array( - 'taxonomy' => 'product_cat', - 'terms' => array( 'cat1', 'cat2' ), - 'field' => 'slug', - 'operator' => 'AND', - 'include_children' => false, - ), - ) ), + array( + 'taxonomy' => 'product_cat', + 'terms' => array( 'cat1', 'cat2' ), + 'field' => 'slug', + 'operator' => 'AND', + 'include_children' => false, + ), + ) + ), 'fields' => 'ids', ); $this->assertEquals( $expected15, $shortcode15->get_query_args() ); // products shortcode -- exclude multiple categories using NOT IN operator. - $shortcode16 = new WC_Shortcode_Products( array( - 'category' => 'cat1,cat2', - 'cat_operator' => 'NOT IN', - ) ); + $shortcode16 = new WC_Shortcode_Products( + array( + 'category' => 'cat1,cat2', + 'cat_operator' => 'NOT IN', + ) + ); $expected16 = array( 'post_type' => 'product', 'post_status' => 'publish', @@ -537,15 +594,18 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'order' => 'ASC', 'posts_per_page' => -1, 'meta_query' => $meta_query, - 'tax_query' => array_merge( $tax_query, array( + 'tax_query' => array_merge( + $tax_query, array( - 'taxonomy' => 'product_cat', - 'terms' => array( 'cat1', 'cat2' ), - 'field' => 'slug', - 'operator' => 'NOT IN', - 'include_children' => true, - ), - ) ), + array( + 'taxonomy' => 'product_cat', + 'terms' => array( 'cat1', 'cat2' ), + 'field' => 'slug', + 'operator' => 'NOT IN', + 'include_children' => true, + ), + ) + ), 'fields' => 'ids', ); @@ -579,9 +639,11 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { $shortcode = new WC_Shortcode_Products(); $this->assertFalse( $shortcode->set_product_as_visible( false ) ); - $shortcode2 = new WC_Shortcode_Products( array( - 'visibility' => 'hidden', - ) ); + $shortcode2 = new WC_Shortcode_Products( + array( + 'visibility' => 'hidden', + ) + ); $this->assertTrue( $shortcode2->set_product_as_visible( false ) ); } @@ -598,9 +660,14 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case { 'groupby' => "$wpdb->posts.ID", ); - $this->assertEquals( $expected, WC_Shortcode_Products::order_by_rating_post_clauses( array( - 'where' => '', - 'join' => '', - ) ) ); + $this->assertEquals( + $expected, + WC_Shortcode_Products::order_by_rating_post_clauses( + array( + 'where' => '', + 'join' => '', + ) + ) + ); } } diff --git a/tests/unit-tests/tax/tax.php b/tests/unit-tests/tax/tax.php index 3a3406ef9ab..ff53ba1c603 100644 --- a/tests/unit-tests/tax/tax.php +++ b/tests/unit-tests/tax/tax.php @@ -28,7 +28,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { $tax_rates = WC_Tax::get_rates(); $this->assertSame( - $tax_rates, array( + $tax_rates, + array( $tax_rate_id => array( 'rate' => 20.0, 'label' => 'VAT', @@ -56,7 +57,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { $tax_rates = WC_Tax::get_rates(); $this->assertSame( - $tax_rates, array( + $tax_rates, + array( $tax_rate_catch_all_id => array( 'rate' => 0.0, 'label' => 'VAT', @@ -89,14 +91,16 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { $tax_rates = WC_Tax::get_shipping_tax_rates(); $this->assertEquals( - $tax_rates, array( + $tax_rates, + array( $tax_rate_id => array( 'rate' => '20.0000', 'label' => 'VAT', 'shipping' => 'yes', 'compound' => 'no', ), - ), print_r( $tax_rates, true ) + ), + print_r( $tax_rates, true ) ); } @@ -121,7 +125,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { $tax_rates = WC_Tax::get_base_tax_rates(); $this->assertEquals( - $tax_rates, array( + $tax_rates, + array( $tax_rate_id => array( 'rate' => '20.0000', 'label' => 'VAT', @@ -161,7 +166,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { ); $this->assertEquals( - $tax_rates, array( + $tax_rates, + array( $tax_rate_id => array( 'rate' => '20.0000', 'label' => 'VAT', @@ -201,7 +207,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { ); $this->assertEquals( - $tax_rates, array( + $tax_rates, + array( $tax_rate_id => array( 'rate' => '20.0000', 'label' => 'VAT', @@ -296,7 +303,8 @@ class WC_Tests_Tax extends WC_Unit_Test_Case { // prices exclusive of tax $calced_tax = WC_Tax::calc_tax( '100', $tax_rates, false, false ); $this->assertEquals( - $calced_tax, array( + $calced_tax, + array( $tax_rate_1_id => '5.0000', $tax_rate_2_id => '8.925', ) diff --git a/tests/unit-tests/templates/functions.php b/tests/unit-tests/templates/functions.php index 677347b2391..48bafed9cb9 100644 --- a/tests/unit-tests/templates/functions.php +++ b/tests/unit-tests/templates/functions.php @@ -44,7 +44,7 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case { 'purchasable', 'product-type-simple', ); - $actual = array_values( wc_get_product_class( 'foo', $product ) ); + $actual = array_values( wc_get_product_class( 'foo', $product ) ); $this->assertEquals( $expected, $actual, print_r( $actual, true ) ); @@ -63,7 +63,7 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case { 'purchasable', 'product-type-simple', ); - $actual = array_values( wc_get_product_class( 'foo', $product ) ); + $actual = array_values( wc_get_product_class( 'foo', $product ) ); $this->assertEquals( $expected, $actual, print_r( $actual, true ) ); add_filter( 'woocommerce_get_product_class_include_taxonomies', '__return_false' ); @@ -91,7 +91,7 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case { wc_dropdown_variation_attribute_options( array( - 'product' => $product, + 'product' => $product, 'attribute' => 'pa_size', ) ); @@ -101,14 +101,14 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case { * Test: test_wc_dropdown_variation_attribute_options_should_return_attributes_list_and_selected_element. */ public function test_wc_dropdown_variation_attribute_options_should_return_attributes_list_and_selected_element() { - $product = WC_Helper_Product::create_variation_product(); + $product = WC_Helper_Product::create_variation_product(); $_REQUEST['attribute_pa_size'] = 'large'; $this->expectOutputString( '' ); wc_dropdown_variation_attribute_options( array( - 'product' => $product, + 'product' => $product, 'attribute' => 'pa_size', ) ); @@ -124,22 +124,22 @@ class WC_Tests_Template_Functions extends WC_Unit_Test_Case { public function test_wc_query_string_form_fields() { $actual_html = wc_query_string_form_fields( '?test=1', array(), '', true ); $expected_html = ''; - $this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + $this->assertEquals( $expected_html, $actual_html ); $actual_html = wc_query_string_form_fields( '?test=1&test2=something', array(), '', true ); $expected_html = ''; - $this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + $this->assertEquals( $expected_html, $actual_html ); - $actual_html = wc_query_string_form_fields( '?test.something=something', array(), '', true ); - $expected_html = ''; - $this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + $actual_html = wc_query_string_form_fields( '?test.something=something.else', array(), '', true ); + $expected_html = ''; + $this->assertEquals( $expected_html, $actual_html ); - $actual_html = wc_query_string_form_fields( '?test+something=something', array(), '', true ); - $expected_html = ''; - $this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + $actual_html = wc_query_string_form_fields( '?test+something=something+else', array(), '', true ); + $expected_html = ''; + $this->assertEquals( $expected_html, $actual_html ); - $actual_html = wc_query_string_form_fields( '?test%20something=something', array(), '', true ); - $expected_html = ''; - $this->assertEquals( $expected_html, $actual_html, var_export( $actual_html, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export + $actual_html = wc_query_string_form_fields( '?test%20something=something%20else', array(), '', true ); + $expected_html = ''; + $this->assertEquals( $expected_html, $actual_html ); } } diff --git a/tests/unit-tests/totals/totals.php b/tests/unit-tests/totals/totals.php index 1732696ba8b..ec4ab27966b 100644 --- a/tests/unit-tests/totals/totals.php +++ b/tests/unit-tests/totals/totals.php @@ -167,7 +167,7 @@ class WC_Tests_Totals extends WC_Unit_Test_Case { public function test_cart_totals() { WC()->customer->set_is_vat_exempt( false ); $this->totals = new WC_Cart_Totals( WC()->cart ); - $cart = WC()->cart; + $cart = WC()->cart; $this->assertEquals( 40.00, $cart->get_fee_total() ); $this->assertEquals( 36.00, $cart->get_cart_contents_total() ); @@ -201,7 +201,7 @@ class WC_Tests_Totals extends WC_Unit_Test_Case { public function test_cart_totals_tax_exempt_customer() { WC()->customer->set_is_vat_exempt( true ); $this->totals = new WC_Cart_Totals( WC()->cart ); - $cart = WC()->cart; + $cart = WC()->cart; $this->assertEquals( 40.00, $cart->get_fee_total() ); $this->assertEquals( 36.00, $cart->get_cart_contents_total() ); diff --git a/tests/unit-tests/util/class-wc-tests-core-functions.php b/tests/unit-tests/util/class-wc-tests-core-functions.php index 19a9339567c..6e997f63b6e 100644 --- a/tests/unit-tests/util/class-wc-tests-core-functions.php +++ b/tests/unit-tests/util/class-wc-tests-core-functions.php @@ -900,10 +900,10 @@ class WC_Tests_Core_Functions extends WC_Unit_Test_Case { 'billing_first_name' => array( 'priority' => 10, ), - 'billing_last_name' => array( + 'billing_last_name' => array( 'priority' => 20, ), - 'billing_email' => array( + 'billing_email' => array( 'priority' => 1, ), ); diff --git a/tests/unit-tests/util/class-wc-tests-user-functions.php b/tests/unit-tests/util/class-wc-tests-user-functions.php index 8e331c4c1f6..f8f3d6cca0e 100644 --- a/tests/unit-tests/util/class-wc-tests-user-functions.php +++ b/tests/unit-tests/util/class-wc-tests-user-functions.php @@ -19,26 +19,32 @@ class WC_Tests_User_Functions extends WC_Unit_Test_Case { public function test_wc_modify_editable_roles() { $password = wp_generate_password(); - $admin_id = wp_insert_user( array( - 'user_login' => 'test_admin', - 'user_pass' => $password, - 'user_email' => 'admin@example.com', - 'role' => 'administrator', - ) ); + $admin_id = wp_insert_user( + array( + 'user_login' => 'test_admin', + 'user_pass' => $password, + 'user_email' => 'admin@example.com', + 'role' => 'administrator', + ) + ); - $editor_id = wp_insert_user( array( - 'user_login' => 'test_editor', - 'user_pass' => $password, - 'user_email' => 'editor@example.com', - 'role' => 'editor', - ) ); + $editor_id = wp_insert_user( + array( + 'user_login' => 'test_editor', + 'user_pass' => $password, + 'user_email' => 'editor@example.com', + 'role' => 'editor', + ) + ); - $manager_id = wp_insert_user( array( - 'user_login' => 'test_manager', - 'user_pass' => $password, - 'user_email' => 'manager@example.com', - 'role' => 'shop_manager', - ) ); + $manager_id = wp_insert_user( + array( + 'user_login' => 'test_manager', + 'user_pass' => $password, + 'user_email' => 'manager@example.com', + 'role' => 'shop_manager', + ) + ); // Admins should be able to edit anyone. wp_set_current_user( $admin_id ); @@ -70,33 +76,41 @@ class WC_Tests_User_Functions extends WC_Unit_Test_Case { public function test_wc_modify_map_meta_cap() { $password = wp_generate_password(); - $admin_id = wp_insert_user( array( - 'user_login' => 'test_admin', - 'user_pass' => $password, - 'user_email' => 'admin@example.com', - 'role' => 'administrator', - ) ); + $admin_id = wp_insert_user( + array( + 'user_login' => 'test_admin', + 'user_pass' => $password, + 'user_email' => 'admin@example.com', + 'role' => 'administrator', + ) + ); - $editor_id = wp_insert_user( array( - 'user_login' => 'test_editor', - 'user_pass' => $password, - 'user_email' => 'editor@example.com', - 'role' => 'editor', - ) ); + $editor_id = wp_insert_user( + array( + 'user_login' => 'test_editor', + 'user_pass' => $password, + 'user_email' => 'editor@example.com', + 'role' => 'editor', + ) + ); - $manager_id = wp_insert_user( array( - 'user_login' => 'test_manager', - 'user_pass' => $password, - 'user_email' => 'manager@example.com', - 'role' => 'shop_manager', - ) ); + $manager_id = wp_insert_user( + array( + 'user_login' => 'test_manager', + 'user_pass' => $password, + 'user_email' => 'manager@example.com', + 'role' => 'shop_manager', + ) + ); - $customer_id = wp_insert_user( array( - 'user_login' => 'test_customer', - 'user_pass' => $password, - 'user_email' => 'customer@example.com', - 'role' => 'customer', - ) ); + $customer_id = wp_insert_user( + array( + 'user_login' => 'test_customer', + 'user_pass' => $password, + 'user_email' => 'customer@example.com', + 'role' => 'customer', + ) + ); // Admins should be able to edit or promote anyone. wp_set_current_user( $admin_id ); @@ -123,21 +137,25 @@ class WC_Tests_User_Functions extends WC_Unit_Test_Case { public function test_wc_shop_manager_has_capability() { $password = wp_generate_password(); - $manager_id = wp_insert_user( array( - 'user_login' => 'test_manager', - 'user_pass' => $password, - 'user_email' => 'manager@example.com', - 'role' => 'shop_manager', - ) ); - $manager = new WP_User( $manager_id ); + $manager_id = wp_insert_user( + array( + 'user_login' => 'test_manager', + 'user_pass' => $password, + 'user_email' => 'manager@example.com', + 'role' => 'shop_manager', + ) + ); + $manager = new WP_User( $manager_id ); - $editor_id = wp_insert_user( array( - 'user_login' => 'test_editor', - 'user_pass' => $password, - 'user_email' => 'editor@example.com', - 'role' => 'editor', - ) ); - $editor = new WP_User( $editor_id ); + $editor_id = wp_insert_user( + array( + 'user_login' => 'test_editor', + 'user_pass' => $password, + 'user_email' => 'editor@example.com', + 'role' => 'editor', + ) + ); + $editor = new WP_User( $editor_id ); // Test capabilities translation is working correctly and only gives shop managers capabilities. $this->assertTrue( $manager->has_cap( 'edit_users' ) ); diff --git a/tests/unit-tests/util/class-wc-tests-wc-query.php b/tests/unit-tests/util/class-wc-tests-wc-query.php index fef9cd1186f..372581808ae 100644 --- a/tests/unit-tests/util/class-wc-tests-wc-query.php +++ b/tests/unit-tests/util/class-wc-tests-wc-query.php @@ -108,7 +108,7 @@ class WC_Tests_WC_Query extends WC_Unit_Test_Case { public function test_add_query_vars() { WC()->query->init_query_vars(); - $vars = array( + $vars = array( 'test1', 'test2', ); diff --git a/tests/unit-tests/util/conditional-functions.php b/tests/unit-tests/util/conditional-functions.php index 6801e8f280c..0e29e287f63 100644 --- a/tests/unit-tests/util/conditional-functions.php +++ b/tests/unit-tests/util/conditional-functions.php @@ -51,11 +51,11 @@ class WC_Tests_Conditional_Functions extends WC_Unit_Test_Case { array( false, wc_is_valid_url( 'https://google.com/test invalid' ) ), // Test some valid URLs - array( true, wc_is_valid_url( 'http://google.com' ) ), - array( true, wc_is_valid_url( 'https://google.com' ) ), - array( true, wc_is_valid_url( 'https://google.com/test%20valid' ) ), - array( true, wc_is_valid_url( 'https://google.com/test-valid/?query=test' ) ), - array( true, wc_is_valid_url( 'https://google.com/test-valid/#hash' ) ), + array( true, wc_is_valid_url( 'http://google.com' ) ), + array( true, wc_is_valid_url( 'https://google.com' ) ), + array( true, wc_is_valid_url( 'https://google.com/test%20valid' ) ), + array( true, wc_is_valid_url( 'https://google.com/test-valid/?query=test' ) ), + array( true, wc_is_valid_url( 'https://google.com/test-valid/#hash' ) ), ); } @@ -86,6 +86,6 @@ class WC_Tests_Conditional_Functions extends WC_Unit_Test_Case { * @since 2.3.0 */ public function test_wc_is_valid_url( $assert, $values ) { - $this->assertEquals( $assert, $values ); + $this->assertEquals( $assert, $values ); } } diff --git a/tests/unit-tests/util/deprecated-hooks.php b/tests/unit-tests/util/deprecated-hooks.php index 1f7c3f7ffc3..8867fe90bb3 100644 --- a/tests/unit-tests/util/deprecated-hooks.php +++ b/tests/unit-tests/util/deprecated-hooks.php @@ -88,8 +88,8 @@ class WC_Tests_Deprecated_Hooks extends WC_Unit_Test_Case { function test_handle_deprecated_hook_filter() { $new_hook = 'wc_new_hook'; $old_hook = 'wc_old_hook'; - $args = array( false ); - $return = -1; + $args = array( false ); + $return = -1; add_filter( $old_hook, array( $this, 'toggle_value' ) ); @@ -103,11 +103,11 @@ class WC_Tests_Deprecated_Hooks extends WC_Unit_Test_Case { * @since 3.0 */ function test_handle_deprecated_hook_action() { - $new_hook = 'wc_new_hook'; - $old_hook = 'wc_old_hook'; + $new_hook = 'wc_new_hook'; + $old_hook = 'wc_old_hook'; $test_value = false; - $args = array( &$test_value ); - $return = -1; + $args = array( &$test_value ); + $return = -1; add_filter( $old_hook, array( $this, 'toggle_value_by_ref' ) ); @@ -135,18 +135,18 @@ class WC_Tests_Deprecated_Hooks extends WC_Unit_Test_Case { * @since 3.0 */ function test_action_handler() { - $test_product = WC_Helper_Product::create_simple_product(); - $test_order = WC_Helper_Order::create_order( 1, $test_product ); + $test_product = WC_Helper_Product::create_simple_product(); + $test_order = WC_Helper_Order::create_order( 1, $test_product ); $test_order_id = $test_order->get_id(); - $test_items = $test_order->get_items(); - $test_item = reset( $test_items ); - $test_item_id = $test_item->get_id(); + $test_items = $test_order->get_items(); + $test_item = reset( $test_items ); + $test_item_id = $test_item->get_id(); add_action( 'woocommerce_order_edit_product', array( $this, 'set_meta' ), 10, 2 ); do_action( 'woocommerce_update_order_item', $test_item_id, $test_item, $test_order_id ); $order_update_worked = (bool) get_post_meta( $test_order_id, 'wc_deprecated_hook_test_item1_meta', 1 ); - $item_update_worked = (bool) get_post_meta( $test_item_id, 'wc_deprecated_hook_test_item2_meta', 2 ); + $item_update_worked = (bool) get_post_meta( $test_item_id, 'wc_deprecated_hook_test_item2_meta', 2 ); $this->assertTrue( $order_update_worked ); $this->assertTrue( $item_update_worked ); @@ -164,7 +164,7 @@ class WC_Tests_Deprecated_Hooks extends WC_Unit_Test_Case { $token = WC_Helper_Payment_Token::create_stub_token( __FUNCTION__ ); $token->save(); - $product = new WC_Product_Variation; + $product = new WC_Product_Variation(); $product->save(); $this->assertEquals( 1, did_action( 'woocommerce_payment_token_created' ) ); diff --git a/tests/unit-tests/util/dummy-wc-logger.php b/tests/unit-tests/util/dummy-wc-logger.php index b91f35a7caa..457545eb3bf 100644 --- a/tests/unit-tests/util/dummy-wc-logger.php +++ b/tests/unit-tests/util/dummy-wc-logger.php @@ -23,7 +23,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * * @param string $level * @param string $message - * @param array $context + * @param array $context */ public function log( $level, $message, $context = array() ) { } @@ -32,7 +32,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function emergency( $message, $context = array() ) { } @@ -41,7 +41,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function alert( $message, $context = array() ) { } @@ -50,7 +50,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function critical( $message, $context = array() ) { } @@ -59,7 +59,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function error( $message, $context = array() ) { } @@ -68,7 +68,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function warning( $message, $context = array() ) { } @@ -77,7 +77,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function notice( $message, $context = array() ) { } @@ -86,7 +86,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function info( $message, $context = array() ) { } @@ -95,7 +95,7 @@ class Dummy_WC_Logger implements WC_Logger_Interface { * Do nothing. * * @param string $message - * @param array $context + * @param array $context */ public function debug( $message, $context = array() ) { } diff --git a/tests/unit-tests/util/plugin-updates.php b/tests/unit-tests/util/plugin-updates.php index e9939370d97..26e1c4209a4 100644 --- a/tests/unit-tests/util/plugin-updates.php +++ b/tests/unit-tests/util/plugin-updates.php @@ -23,10 +23,10 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { if ( ! class_exists( 'WC_Plugin_Updates' ) ) { $bootstrap = WC_Unit_Tests_Bootstrap::instance(); - include_once( $bootstrap->plugin_dir . '/includes/admin/plugin-updates/class-wc-plugin-updates.php' ); + include_once $bootstrap->plugin_dir . '/includes/admin/plugin-updates/class-wc-plugin-updates.php'; } - $this->updates = new WC_Plugin_Updates; + $this->updates = new WC_Plugin_Updates(); $this->plugins = array(); add_filter( 'woocommerce_get_plugins_with_header', array( $this, 'populate_untested_plugins' ), 10, 2 ); @@ -35,7 +35,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { /** * Allow this test suite to easily define plugin results to test for the version tested header. * - * @param array $plugins array of plugin data in same format as get_plugins. + * @param array $plugins array of plugin data in same format as get_plugins. * @param string $header plugin header results matched on. * @return array modified $plugins. * @since 3.2.0 @@ -57,7 +57,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { $release = 'major'; $this->plugins = array( - 'test/test.php' => array( + 'test/test.php' => array( 'Name' => 'Test plugin', WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.0.0', ), @@ -74,29 +74,29 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.0.1', ), ); - $new_version = '4.0.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $new_version = '4.0.0'; + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); $this->assertArrayNotHasKey( 'test4/test4.php', $untested ); $new_version = '3.9.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); $this->assertArrayNotHasKey( 'test4/test4.php', $untested ); $new_version = '4.3.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); $this->assertArrayNotHasKey( 'test4/test4.php', $untested ); $new_version = '4.0.2'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); @@ -112,7 +112,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { $release = 'major'; $this->plugins = array( - 'test/test.php' => array( + 'test/test.php' => array( 'Name' => 'Test plugin', WC_Plugin_Updates::VERSION_TESTED_HEADER => '3.0.0', ), @@ -125,18 +125,18 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { WC_Plugin_Updates::VERSION_TESTED_HEADER => '3.0', ), ); - $plugin_keys = array_keys( $this->plugins ); + $plugin_keys = array_keys( $this->plugins ); $new_version = '4.0.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); $new_version = '4.3.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); $new_version = '4.0.2'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); } @@ -149,7 +149,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { $release = 'minor'; $this->plugins = array( - 'test/test.php' => array( + 'test/test.php' => array( 'Name' => 'Test plugin', WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.1.0', ), @@ -166,22 +166,22 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.2.1', ), ); - $new_version = '4.1.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $new_version = '4.1.0'; + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); $this->assertArrayNotHasKey( 'test4/test4.php', $untested ); $new_version = '4.2.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayHasKey( 'test3/test3.php', $untested ); $this->assertArrayNotHasKey( 'test4/test4.php', $untested ); $new_version = '4.1.5'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); @@ -197,7 +197,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { $release = 'minor'; $this->plugins = array( - 'test/test.php' => array( + 'test/test.php' => array( 'Name' => 'Test plugin', WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.1.0', ), @@ -210,14 +210,14 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { WC_Plugin_Updates::VERSION_TESTED_HEADER => '4.2', ), ); - $plugin_keys = array_keys( $this->plugins ); + $plugin_keys = array_keys( $this->plugins ); $new_version = '4.3.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); $new_version = '4.3.1'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertEquals( $plugin_keys, array_intersect( $plugin_keys, array_keys( $untested ) ) ); $new_version = '4.1.0'; @@ -237,7 +237,7 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { $release = 'minor'; $this->plugins = array( - 'test/test.php' => array( + 'test/test.php' => array( 'Name' => 'Test plugin', WC_Plugin_Updates::VERSION_TESTED_HEADER => '4', ), @@ -255,13 +255,13 @@ class WC_Tests_Plugin_Updates extends WC_Unit_Test_Case { ), ); - $release = 'major'; + $release = 'major'; $new_version = '5.0.0'; $this->assertArrayHasKey( 'test/test.php', $this->updates->get_untested_plugins( $new_version, $release ) ); - $release = 'minor'; + $release = 'minor'; $new_version = '4.1.0'; - $untested = $this->updates->get_untested_plugins( $new_version, $release ); + $untested = $this->updates->get_untested_plugins( $new_version, $release ); $this->assertArrayNotHasKey( 'test/test.php', $untested ); $this->assertArrayNotHasKey( 'test2/test2.php', $untested ); $this->assertArrayNotHasKey( 'test3/test3.php', $untested ); diff --git a/tests/unit-tests/widgets/class-dummy-widget.php b/tests/unit-tests/widgets/class-dummy-widget.php index 8afe82bba7a..f8aa56223d6 100644 --- a/tests/unit-tests/widgets/class-dummy-widget.php +++ b/tests/unit-tests/widgets/class-dummy-widget.php @@ -17,7 +17,7 @@ class Dummy_Widget extends WC_Widget { /** * Output widget. * - * @param mixed $args Arguments. + * @param mixed $args Arguments. * @param WP_Widget $instance Intance of WP_Widget. * @return void */ diff --git a/tests/unit-tests/widgets/class-wc-tests-widget.php b/tests/unit-tests/widgets/class-wc-tests-widget.php index bbdbd34b604..694fe754922 100644 --- a/tests/unit-tests/widgets/class-wc-tests-widget.php +++ b/tests/unit-tests/widgets/class-wc-tests-widget.php @@ -35,7 +35,7 @@ class WC_Tests_Widget extends WC_Unit_Test_Case { // Uncached widget. ob_start(); $cache_hit = $dummy_widget->get_cached_widget( array( 'widget_id' => $dummy_widget->widget_id ) ); - $output = ob_get_clean(); + $output = ob_get_clean(); $this->assertFalse( $cache_hit ); $this->assertEmpty( $output ); @@ -47,7 +47,7 @@ class WC_Tests_Widget extends WC_Unit_Test_Case { // Cached widget. ob_start(); $cache_hit = $dummy_widget->get_cached_widget( array( 'widget_id' => $dummy_widget->widget_id ) ); - $output = ob_get_clean(); + $output = ob_get_clean(); $this->assertTrue( $cache_hit ); $this->assertEquals( 'Dummy', $output ); }