File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed
Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public static function is_session_handler_disabled() {
6969 public static function initialize_session_and_cart () {
7070 // Clear any existing WooCommerce objects to ensure fresh initialization
7171 // with the correct user context after JWT authentication.
72-
72+
7373 // @phpstan-ignore-next-line
7474 \WC ()->customer = null ;
7575 // @phpstan-ignore-next-line
Original file line number Diff line number Diff line change @@ -939,6 +939,14 @@ static function () {
939939 $ zone ->add_shipping_method ( 'flat_rate ' );
940940 $ zone ->add_shipping_method ( 'free_shipping ' );
941941
942+ $ zone = new \WC_Shipping_Zone ();
943+ $ zone ->set_zone_name ( 'US ' );
944+ $ zone ->set_zone_order ( 5 );
945+ $ zone ->add_location ( 'US:NY ' , 'state ' );
946+ $ zone ->save ();
947+ $ zone ->add_shipping_method ( 'flat_rate ' );
948+ $ zone ->add_shipping_method ( 'free_shipping ' );
949+
942950 global $ wp_rewrite ;
943951
944952 //Write the rule
Original file line number Diff line number Diff line change 319319// any existing sessions.
320320$ new_session_token = $ success ['data ' ]['login ' ]['sessionToken ' ];
321321
322- $ I ->wantTo ( 'Check the cart and should be empty ' );
322+ $ I ->wantTo ( 'Check the cart and should contain the contents from our guest session ' );
323323
324324$ cart_query = '
325325 query {
346346 'woocommerce-session ' => "Session {$ new_session_token }" ,
347347 ]
348348);
349- $ expected_results = [
350- 'data ' => [
351- 'cart ' => [
352- 'contents ' => [
353- 'nodes ' => [],
354- ],
355- ],
356- ],
357- ];
358349
359350$ I ->assertEquals ( $ expected_results , $ response );
You can’t perform that action at this time.
0 commit comments