@@ -291,32 +291,28 @@ public function testExecuteWithExistentCustomer()
291
291
],
292
292
'subscription ' => $ subscription ,
293
293
];
294
- $ filteredData = [
294
+ $ extractedData = [
295
295
'entity_id ' => $ customerId ,
296
296
'code ' => 'value ' ,
297
297
'coolness ' => false ,
298
298
'disable_auto_group_change ' => 'false ' ,
299
299
];
300
- $ dataToCompact = [
300
+ $ compactedData = [
301
301
'entity_id ' => $ customerId ,
302
302
'code ' => 'value ' ,
303
303
'coolness ' => false ,
304
304
'disable_auto_group_change ' => 'false ' ,
305
- CustomerInterface::DEFAULT_BILLING => false ,
306
- CustomerInterface::DEFAULT_SHIPPING => false ,
307
- 'confirmation ' => false ,
308
- 'sendemail_store_id ' => false ,
305
+ CustomerInterface::DEFAULT_BILLING => 2 ,
306
+ CustomerInterface::DEFAULT_SHIPPING => 2 ,
309
307
];
310
- $ addressFilteredData = [
308
+ $ addressExtractedData = [
311
309
'entity_id ' => $ addressId ,
312
- 'default_billing ' => 'true ' ,
313
- 'default_shipping ' => 'true ' ,
314
310
'code ' => 'value ' ,
315
311
'coolness ' => false ,
316
312
'region ' => 'region ' ,
317
313
'region_id ' => 'region_id ' ,
318
314
];
319
- $ addressDataToCompact = [
315
+ $ addressCompactedData = [
320
316
'entity_id ' => $ addressId ,
321
317
'default_billing ' => 'true ' ,
322
318
'default_shipping ' => 'true ' ,
@@ -417,11 +413,11 @@ public function testExecuteWithExistentCustomer()
417
413
$ customerFormMock ->expects ($ this ->once ())
418
414
->method ('extractData ' )
419
415
->with ($ this ->requestMock , 'customer ' )
420
- ->willReturn ($ filteredData );
416
+ ->willReturn ($ extractedData );
421
417
$ customerFormMock ->expects ($ this ->once ())
422
418
->method ('compactData ' )
423
- ->with ($ dataToCompact )
424
- ->willReturn ($ filteredData );
419
+ ->with ($ extractedData )
420
+ ->willReturn ($ compactedData );
425
421
$ customerFormMock ->expects ($ this ->once ())
426
422
->method ('getAttributes ' )
427
423
->willReturn ($ attributes );
@@ -432,11 +428,11 @@ public function testExecuteWithExistentCustomer()
432
428
$ customerAddressFormMock ->expects ($ this ->once ())
433
429
->method ('extractData ' )
434
430
->with ($ this ->requestMock , 'address/ ' . $ addressId )
435
- ->willReturn ($ addressFilteredData );
431
+ ->willReturn ($ addressExtractedData );
436
432
$ customerAddressFormMock ->expects ($ this ->once ())
437
433
->method ('compactData ' )
438
- ->with ($ addressDataToCompact )
439
- ->willReturn ($ addressFilteredData );
434
+ ->with ($ addressExtractedData )
435
+ ->willReturn ($ addressCompactedData );
440
436
$ customerAddressFormMock ->expects ($ this ->once ())
441
437
->method ('getAttributes ' )
442
438
->willReturn ($ attributes );
@@ -606,8 +602,6 @@ public function testExecuteWithNewCustomer()
606
602
'_template_ ' => '_template_ ' ,
607
603
$ addressId => [
608
604
'entity_id ' => $ addressId ,
609
- 'default_billing ' => 'false ' ,
610
- 'default_shipping ' => 'false ' ,
611
605
'code ' => 'value ' ,
612
606
'coolness ' => false ,
613
607
'region ' => 'region ' ,
@@ -616,31 +610,12 @@ public function testExecuteWithNewCustomer()
616
610
],
617
611
'subscription ' => $ subscription ,
618
612
];
619
- $ filteredData = [
613
+ $ extractedData = [
620
614
'coolness ' => false ,
621
615
'disable_auto_group_change ' => 'false ' ,
622
616
];
623
- $ dataToCompact = [
624
- 'coolness ' => false ,
625
- 'disable_auto_group_change ' => 'false ' ,
626
- CustomerInterface::DEFAULT_BILLING => false ,
627
- CustomerInterface::DEFAULT_SHIPPING => false ,
628
- 'confirmation ' => false ,
629
- 'sendemail_store_id ' => false ,
630
- ];
631
- $ addressFilteredData = [
617
+ $ addressExtractedData = [
632
618
'entity_id ' => $ addressId ,
633
- 'default_billing ' => 'false ' ,
634
- 'default_shipping ' => 'false ' ,
635
- 'code ' => 'value ' ,
636
- 'coolness ' => false ,
637
- 'region ' => 'region ' ,
638
- 'region_id ' => 'region_id ' ,
639
- ];
640
- $ addressDataToCompact = [
641
- 'entity_id ' => $ addressId ,
642
- 'default_billing ' => 'false ' ,
643
- 'default_shipping ' => 'false ' ,
644
619
'code ' => 'value ' ,
645
620
'coolness ' => false ,
646
621
'region ' => 'region ' ,
@@ -720,11 +695,11 @@ public function testExecuteWithNewCustomer()
720
695
$ customerFormMock ->expects ($ this ->once ())
721
696
->method ('extractData ' )
722
697
->with ($ this ->requestMock , 'customer ' )
723
- ->willReturn ($ filteredData );
698
+ ->willReturn ($ extractedData );
724
699
$ customerFormMock ->expects ($ this ->once ())
725
700
->method ('compactData ' )
726
- ->with ($ dataToCompact )
727
- ->willReturn ($ filteredData );
701
+ ->with ($ extractedData )
702
+ ->willReturn ($ extractedData );
728
703
$ customerFormMock ->expects ($ this ->once ())
729
704
->method ('getAttributes ' )
730
705
->willReturn ($ attributes );
@@ -735,11 +710,11 @@ public function testExecuteWithNewCustomer()
735
710
$ customerAddressFormMock ->expects ($ this ->once ())
736
711
->method ('extractData ' )
737
712
->with ($ this ->requestMock , 'address/ ' . $ addressId )
738
- ->willReturn ($ addressFilteredData );
713
+ ->willReturn ($ addressExtractedData );
739
714
$ customerAddressFormMock ->expects ($ this ->once ())
740
715
->method ('compactData ' )
741
- ->with ($ addressDataToCompact )
742
- ->willReturn ($ addressFilteredData );
716
+ ->with ($ addressExtractedData )
717
+ ->willReturn ($ addressExtractedData );
743
718
$ customerAddressFormMock ->expects ($ this ->once ())
744
719
->method ('getAttributes ' )
745
720
->willReturn ($ attributes );
@@ -893,18 +868,10 @@ public function testExecuteWithNewCustomerAndValidationException()
893
868
],
894
869
'subscription ' => $ subscription ,
895
870
];
896
- $ filteredData = [
871
+ $ extractedData = [
897
872
'coolness ' => false ,
898
873
'disable_auto_group_change ' => 'false ' ,
899
874
];
900
- $ dataToCompact = [
901
- 'coolness ' => false ,
902
- 'disable_auto_group_change ' => 'false ' ,
903
- CustomerInterface::DEFAULT_BILLING => false ,
904
- CustomerInterface::DEFAULT_SHIPPING => false ,
905
- 'confirmation ' => false ,
906
- 'sendemail_store_id ' => false ,
907
- ];
908
875
909
876
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $attributeMock */
910
877
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -954,11 +921,11 @@ public function testExecuteWithNewCustomerAndValidationException()
954
921
$ customerFormMock ->expects ($ this ->once ())
955
922
->method ('extractData ' )
956
923
->with ($ this ->requestMock , 'customer ' )
957
- ->willReturn ($ filteredData );
924
+ ->willReturn ($ extractedData );
958
925
$ customerFormMock ->expects ($ this ->once ())
959
926
->method ('compactData ' )
960
- ->with ($ dataToCompact )
961
- ->willReturn ($ filteredData );
927
+ ->with ($ extractedData )
928
+ ->willReturn ($ extractedData );
962
929
$ customerFormMock ->expects ($ this ->once ())
963
930
->method ('getAttributes ' )
964
931
->willReturn ($ attributes );
@@ -1045,18 +1012,10 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1045
1012
],
1046
1013
'subscription ' => $ subscription ,
1047
1014
];
1048
- $ filteredData = [
1015
+ $ extractedData = [
1049
1016
'coolness ' => false ,
1050
1017
'disable_auto_group_change ' => 'false ' ,
1051
1018
];
1052
- $ dataToCompact = [
1053
- 'coolness ' => false ,
1054
- 'disable_auto_group_change ' => 'false ' ,
1055
- CustomerInterface::DEFAULT_BILLING => false ,
1056
- CustomerInterface::DEFAULT_SHIPPING => false ,
1057
- 'confirmation ' => false ,
1058
- 'sendemail_store_id ' => false ,
1059
- ];
1060
1019
1061
1020
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $attributeMock */
1062
1021
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -1106,11 +1065,11 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1106
1065
$ customerFormMock ->expects ($ this ->once ())
1107
1066
->method ('extractData ' )
1108
1067
->with ($ this ->requestMock , 'customer ' )
1109
- ->willReturn ($ filteredData );
1068
+ ->willReturn ($ extractedData );
1110
1069
$ customerFormMock ->expects ($ this ->once ())
1111
1070
->method ('compactData ' )
1112
- ->with ($ dataToCompact )
1113
- ->willReturn ($ filteredData );
1071
+ ->with ($ extractedData )
1072
+ ->willReturn ($ extractedData );
1114
1073
$ customerFormMock ->expects ($ this ->once ())
1115
1074
->method ('getAttributes ' )
1116
1075
->willReturn ($ attributes );
@@ -1197,17 +1156,9 @@ public function testExecuteWithNewCustomerAndException()
1197
1156
],
1198
1157
'subscription ' => $ subscription ,
1199
1158
];
1200
- $ filteredData = [
1201
- 'coolness ' => false ,
1202
- 'disable_auto_group_change ' => 'false ' ,
1203
- ];
1204
- $ dataToCompact = [
1159
+ $ extractedData = [
1205
1160
'coolness ' => false ,
1206
1161
'disable_auto_group_change ' => 'false ' ,
1207
- CustomerInterface::DEFAULT_BILLING => false ,
1208
- CustomerInterface::DEFAULT_SHIPPING => false ,
1209
- 'confirmation ' => false ,
1210
- 'sendemail_store_id ' => false ,
1211
1162
];
1212
1163
1213
1164
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $attributeMock */
@@ -1258,11 +1209,11 @@ public function testExecuteWithNewCustomerAndException()
1258
1209
$ customerFormMock ->expects ($ this ->once ())
1259
1210
->method ('extractData ' )
1260
1211
->with ($ this ->requestMock , 'customer ' )
1261
- ->willReturn ($ filteredData );
1212
+ ->willReturn ($ extractedData );
1262
1213
$ customerFormMock ->expects ($ this ->once ())
1263
1214
->method ('compactData ' )
1264
- ->with ($ dataToCompact )
1265
- ->willReturn ($ filteredData );
1215
+ ->with ($ extractedData )
1216
+ ->willReturn ($ extractedData );
1266
1217
$ customerFormMock ->expects ($ this ->once ())
1267
1218
->method ('getAttributes ' )
1268
1219
->willReturn ($ attributes );
0 commit comments