@@ -60,12 +60,14 @@ public function test_hides_ece_if_cannot_compute_taxes() {
60
60
'allowed_items_in_cart ' ,
61
61
'should_show_ece_on_cart_page ' ,
62
62
'should_show_ece_on_checkout_page ' ,
63
+ 'is_pay_for_order_page ' ,
63
64
]
64
65
);
65
66
$ wc_stripe_ece_helper_mock ->expects ( $ this ->any () )->method ( 'is_product ' )->willReturn ( false );
66
67
$ wc_stripe_ece_helper_mock ->expects ( $ this ->any () )->method ( 'allowed_items_in_cart ' )->willReturn ( true );
67
68
$ wc_stripe_ece_helper_mock ->expects ( $ this ->any () )->method ( 'should_show_ece_on_cart_page ' )->willReturn ( true );
68
69
$ wc_stripe_ece_helper_mock ->expects ( $ this ->any () )->method ( 'should_show_ece_on_checkout_page ' )->willReturn ( true );
70
+ $ wc_stripe_ece_helper_mock ->expects ( $ this ->any () )->method ( 'is_pay_for_order_page ' )->willReturnOnConsecutiveCalls ( true , false );
69
71
$ wc_stripe_ece_helper_mock ->testmode = true ;
70
72
if ( ! defined ( 'WOOCOMMERCE_CHECKOUT ' ) ) {
71
73
define ( 'WOOCOMMERCE_CHECKOUT ' , true );
@@ -83,6 +85,10 @@ public function test_hides_ece_if_cannot_compute_taxes() {
83
85
WC ()->session ->init ();
84
86
WC ()->cart ->add_to_cart ( $ virtual_product ->get_id (), 1 );
85
87
88
+ // Do not hide if Pay for Order page.
89
+ update_option ( 'woocommerce_tax_based_on ' , 'shipping ' );
90
+ $ this ->assertTrue ( $ wc_stripe_ece_helper_mock ->should_show_express_checkout_button () );
91
+
86
92
// Hide if cart has virtual product and tax is based on shipping or billing address.
87
93
update_option ( 'woocommerce_calc_taxes ' , 'yes ' );
88
94
update_option ( 'woocommerce_tax_based_on ' , 'billing ' );
0 commit comments