@@ -455,14 +455,20 @@ public function testExecute(
455
455
$ regionCode ,
456
456
$ newRegionId ,
457
457
$ newRegion ,
458
- $ newRegionCode
458
+ $ newRegionCode ,
459
+ $ existingDefaultBilling = false ,
460
+ $ existingDefaultShipping = false ,
461
+ $ setDefaultBilling = false ,
462
+ $ setDefaultShipping = false
459
463
): void {
460
464
$ existingAddressData = [
461
465
'country_id ' => $ countryId ,
462
466
'region_id ' => $ regionId ,
463
467
'region ' => $ region ,
464
468
'region_code ' => $ regionCode ,
465
- 'customer_id ' => $ customerId
469
+ 'customer_id ' => $ customerId ,
470
+ 'default_billing ' => $ existingDefaultBilling ,
471
+ 'default_shipping ' => $ existingDefaultShipping ,
466
472
];
467
473
$ newAddressData = [
468
474
'country_id ' => $ countryId ,
@@ -486,8 +492,8 @@ public function testExecute(
486
492
->method ('getParam ' )
487
493
->willReturnMap ([
488
494
['id ' , null , $ addressId ],
489
- ['default_billing ' , false , $ addressId ],
490
- ['default_shipping ' , false , $ addressId ],
495
+ ['default_billing ' , $ existingDefaultBilling , $ setDefaultBilling ],
496
+ ['default_shipping ' , $ existingDefaultShipping , $ setDefaultShipping ],
491
497
]);
492
498
493
499
$ this ->addressRepository ->expects ($ this ->once ())
@@ -565,11 +571,11 @@ public function testExecute(
565
571
->willReturnSelf ();
566
572
$ this ->addressData ->expects ($ this ->once ())
567
573
->method ('setIsDefaultBilling ' )
568
- ->with ()
574
+ ->with ($ setDefaultBilling )
569
575
->willReturnSelf ();
570
576
$ this ->addressData ->expects ($ this ->once ())
571
577
->method ('setIsDefaultShipping ' )
572
- ->with ()
578
+ ->with ($ setDefaultShipping )
573
579
->willReturnSelf ();
574
580
575
581
$ this ->messageManager ->expects ($ this ->once ())
@@ -628,11 +634,11 @@ public function dataProviderTestExecute(): array
628
634
629
635
[1 , 1 , 1 , 2 , null , null , 12 , null , null ],
630
636
[1 , 1 , 1 , 2 , 'Alaska ' , null , 12 , null , 'CA ' ],
631
- [1 , 1 , 1 , 2 , 'Alaska ' , 'AK ' , 12 , 'California ' , null ],
637
+ [1 , 1 , 1 , 2 , 'Alaska ' , 'AK ' , 12 , 'California ' , null , true , true , true , false ],
632
638
633
- [1 , 1 , 1 , 2 , null , null , 12 , null , null ],
634
- [1 , 1 , 1 , 2 , 'Alaska ' , null , 12 , null , 'CA ' ],
635
- [1 , 1 , 1 , 2 , 'Alaska ' , 'AK ' , 12 , 'California ' , null ],
639
+ [1 , 1 , 1 , 2 , null , null , 12 , null , null , false , false , true , false ],
640
+ [1 , 1 , 1 , 2 , 'Alaska ' , null , 12 , null , 'CA ' , true , false , true , false ],
641
+ [1 , 1 , 1 , 2 , 'Alaska ' , 'AK ' , 12 , 'California ' , null , true , true , true , true ],
636
642
];
637
643
}
638
644
0 commit comments