* Ensure phpunit tests are running against the blocks code and not what is included in WooCommerce core.

* cast to object to correct response expectations.

The change in https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3679/files#diff-5d8cf88af3d9be56abf0b110a7500b3711552009533d894e07f0e891b4af266eL317 resulted in a change in shape for the response.
This commit is contained in:
Darren Ethier 2021-01-16 02:48:46 -05:00 committed by GitHub
parent ca471e1320
commit dd1415c73b
2 changed files with 2 additions and 1 deletions

View File

@ -338,7 +338,7 @@ class CartSchema extends AbstractSchema {
'needs_shipping' => $cart->needs_shipping(),
'has_calculated_shipping' => $has_calculated_shipping,
'fees' => $this->get_item_responses_from_schema( $this->fee_schema, $cart->get_fees() ),
'totals' => $this->prepare_currency_response(
'totals' => (object) $this->prepare_currency_response(
[
'total_items' => $this->prepare_money_response( $cart->get_subtotal(), wc_get_price_decimals() ),
'total_items_tax' => $this->prepare_money_response( $cart->get_subtotal_tax(), wc_get_price_decimals() ),

View File

@ -107,6 +107,7 @@ function wc_install_core() {
tests_add_filter(
'muplugins_loaded',
function() {
define( 'JETPACK_AUTOLOAD_DEV', true );
wc_load_core();
// install blocks plugin
wc_blocks_install();