Fix broken PHPunit tests (https://github.com/woocommerce/woocommerce-blocks/pull/3690)
* 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:
parent
ca471e1320
commit
dd1415c73b
|
@ -338,7 +338,7 @@ class CartSchema extends AbstractSchema {
|
||||||
'needs_shipping' => $cart->needs_shipping(),
|
'needs_shipping' => $cart->needs_shipping(),
|
||||||
'has_calculated_shipping' => $has_calculated_shipping,
|
'has_calculated_shipping' => $has_calculated_shipping,
|
||||||
'fees' => $this->get_item_responses_from_schema( $this->fee_schema, $cart->get_fees() ),
|
'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' => $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() ),
|
'total_items_tax' => $this->prepare_money_response( $cart->get_subtotal_tax(), wc_get_price_decimals() ),
|
||||||
|
|
|
@ -107,6 +107,7 @@ function wc_install_core() {
|
||||||
tests_add_filter(
|
tests_add_filter(
|
||||||
'muplugins_loaded',
|
'muplugins_loaded',
|
||||||
function() {
|
function() {
|
||||||
|
define( 'JETPACK_AUTOLOAD_DEV', true );
|
||||||
wc_load_core();
|
wc_load_core();
|
||||||
// install blocks plugin
|
// install blocks plugin
|
||||||
wc_blocks_install();
|
wc_blocks_install();
|
||||||
|
|
Loading…
Reference in New Issue