@@ -302,33 +302,30 @@ public function testExecuteWithExistentCustomer()
302
302
],
303
303
'subscription ' => $ subscription ,
304
304
];
305
- $ filteredData = [
305
+ $ extractedData = [
306
306
'entity_id ' => $ customerId ,
307
307
'code ' => 'value ' ,
308
308
'coolness ' => false ,
309
309
'disable_auto_group_change ' => 'false ' ,
310
310
];
311
- $ dataToCompact = [
311
+ $ compactedData = [
312
312
'entity_id ' => $ customerId ,
313
313
'code ' => 'value ' ,
314
314
'coolness ' => false ,
315
315
'disable_auto_group_change ' => 'false ' ,
316
- CustomerInterface::DEFAULT_BILLING => false ,
317
- CustomerInterface::DEFAULT_SHIPPING => false ,
318
- 'confirmation ' => false ,
319
- 'sendemail_store_id ' => false ,
320
- 'extension_attributes ' => false ,
316
+ CustomerInterface::DEFAULT_BILLING => 2 ,
317
+ CustomerInterface::DEFAULT_SHIPPING => 2
321
318
];
322
- $ addressFilteredData = [
319
+ $ addressExtractedData = [
323
320
'entity_id ' => $ addressId ,
324
- 'default_billing ' => 'true ' ,
325
- 'default_shipping ' => 'true ' ,
321
+ /* 'default_billing' => 'true',
322
+ 'default_shipping' => 'true',*/
326
323
'code ' => 'value ' ,
327
324
'coolness ' => false ,
328
325
'region ' => 'region ' ,
329
326
'region_id ' => 'region_id ' ,
330
327
];
331
- $ addressDataToCompact = [
328
+ $ addressCompactedData = [
332
329
'entity_id ' => $ addressId ,
333
330
'default_billing ' => 'true ' ,
334
331
'default_shipping ' => 'true ' ,
@@ -428,11 +425,11 @@ public function testExecuteWithExistentCustomer()
428
425
$ customerFormMock ->expects ($ this ->once ())
429
426
->method ('extractData ' )
430
427
->with ($ this ->requestMock , 'customer ' )
431
- ->willReturn ($ filteredData );
428
+ ->willReturn ($ extractedData );
432
429
$ customerFormMock ->expects ($ this ->once ())
433
430
->method ('compactData ' )
434
- ->with ($ dataToCompact )
435
- ->willReturn ($ filteredData );
431
+ ->with ($ extractedData )
432
+ ->willReturn ($ compactedData );
436
433
$ customerFormMock ->expects ($ this ->once ())
437
434
->method ('getAttributes ' )
438
435
->willReturn ($ attributes );
@@ -443,11 +440,11 @@ public function testExecuteWithExistentCustomer()
443
440
$ customerAddressFormMock ->expects ($ this ->once ())
444
441
->method ('extractData ' )
445
442
->with ($ this ->requestMock , 'address/ ' . $ addressId )
446
- ->willReturn ($ addressFilteredData );
443
+ ->willReturn ($ addressExtractedData );
447
444
$ customerAddressFormMock ->expects ($ this ->once ())
448
445
->method ('compactData ' )
449
- ->with ($ addressDataToCompact )
450
- ->willReturn ($ addressFilteredData );
446
+ ->with ($ addressExtractedData )
447
+ ->willReturn ($ addressCompactedData );
451
448
$ customerAddressFormMock ->expects ($ this ->once ())
452
449
->method ('getAttributes ' )
453
450
->willReturn ($ attributes );
@@ -635,33 +632,13 @@ public function testExecuteWithNewCustomer()
635
632
],
636
633
'subscription ' => $ subscription ,
637
634
];
638
- $ filteredData = [
635
+ $ extractedData = [
639
636
'coolness ' => false ,
640
637
'disable_auto_group_change ' => 'false ' ,
641
638
];
642
- $ dataToCompact = [
643
- 'coolness ' => false ,
644
- 'disable_auto_group_change ' => 'false ' ,
645
- CustomerInterface::DEFAULT_BILLING => false ,
646
- CustomerInterface::DEFAULT_SHIPPING => false ,
647
- 'confirmation ' => false ,
648
- 'sendemail_store_id ' => false ,
649
- 'extension_attributes ' => false ,
650
- ];
651
- $ addressFilteredData = [
639
+ $ addressExtractedData = [
652
640
'entity_id ' => $ addressId ,
653
- 'default_billing ' => 'false ' ,
654
- 'default_shipping ' => 'false ' ,
655
- 'code ' => 'value ' ,
656
- 'coolness ' => false ,
657
- 'region ' => 'region ' ,
658
- 'region_id ' => 'region_id ' ,
659
- ];
660
- $ addressDataToCompact = [
661
- 'entity_id ' => $ addressId ,
662
- 'default_billing ' => 'false ' ,
663
- 'default_shipping ' => 'false ' ,
664
- 'code ' => 'value ' ,
641
+ 'code ' => 'value ' ,
665
642
'coolness ' => false ,
666
643
'region ' => 'region ' ,
667
644
'region_id ' => 'region_id ' ,
@@ -739,11 +716,11 @@ public function testExecuteWithNewCustomer()
739
716
$ customerFormMock ->expects ($ this ->once ())
740
717
->method ('extractData ' )
741
718
->with ($ this ->requestMock , 'customer ' )
742
- ->willReturn ($ filteredData );
719
+ ->willReturn ($ extractedData );
743
720
$ customerFormMock ->expects ($ this ->once ())
744
721
->method ('compactData ' )
745
- ->with ($ dataToCompact )
746
- ->willReturn ($ filteredData );
722
+ ->with ($ extractedData )
723
+ ->willReturn ($ extractedData );
747
724
$ customerFormMock ->expects ($ this ->once ())
748
725
->method ('getAttributes ' )
749
726
->willReturn ($ attributes );
@@ -754,11 +731,11 @@ public function testExecuteWithNewCustomer()
754
731
$ customerAddressFormMock ->expects ($ this ->once ())
755
732
->method ('extractData ' )
756
733
->with ($ this ->requestMock , 'address/ ' . $ addressId )
757
- ->willReturn ($ addressFilteredData );
734
+ ->willReturn ($ addressExtractedData );
758
735
$ customerAddressFormMock ->expects ($ this ->once ())
759
736
->method ('compactData ' )
760
- ->with ($ addressDataToCompact )
761
- ->willReturn ($ addressFilteredData );
737
+ ->with ($ addressExtractedData )
738
+ ->willReturn ($ addressExtractedData );
762
739
$ customerAddressFormMock ->expects ($ this ->once ())
763
740
->method ('getAttributes ' )
764
741
->willReturn ($ attributes );
@@ -912,19 +889,10 @@ public function testExecuteWithNewCustomerAndValidationException()
912
889
],
913
890
'subscription ' => $ subscription ,
914
891
];
915
- $ filteredData = [
892
+ $ extractedData = [
916
893
'coolness ' => false ,
917
894
'disable_auto_group_change ' => 'false ' ,
918
895
];
919
- $ dataToCompact = [
920
- 'coolness ' => false ,
921
- 'disable_auto_group_change ' => 'false ' ,
922
- CustomerInterface::DEFAULT_BILLING => false ,
923
- CustomerInterface::DEFAULT_SHIPPING => false ,
924
- 'confirmation ' => false ,
925
- 'sendemail_store_id ' => false ,
926
- 'extension_attributes ' => false ,
927
- ];
928
896
929
897
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
930
898
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -973,11 +941,11 @@ public function testExecuteWithNewCustomerAndValidationException()
973
941
$ customerFormMock ->expects ($ this ->once ())
974
942
->method ('extractData ' )
975
943
->with ($ this ->requestMock , 'customer ' )
976
- ->willReturn ($ filteredData );
944
+ ->willReturn ($ extractedData );
977
945
$ customerFormMock ->expects ($ this ->once ())
978
946
->method ('compactData ' )
979
- ->with ($ dataToCompact )
980
- ->willReturn ($ filteredData );
947
+ ->with ($ extractedData )
948
+ ->willReturn ($ extractedData );
981
949
$ customerFormMock ->expects ($ this ->once ())
982
950
->method ('getAttributes ' )
983
951
->willReturn ($ attributes );
@@ -1064,18 +1032,9 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1064
1032
],
1065
1033
'subscription ' => $ subscription ,
1066
1034
];
1067
- $ filteredData = [
1068
- 'coolness ' => false ,
1069
- 'disable_auto_group_change ' => 'false ' ,
1070
- ];
1071
- $ dataToCompact = [
1035
+ $ extractedData = [
1072
1036
'coolness ' => false ,
1073
1037
'disable_auto_group_change ' => 'false ' ,
1074
- CustomerInterface::DEFAULT_BILLING => false ,
1075
- CustomerInterface::DEFAULT_SHIPPING => false ,
1076
- 'confirmation ' => false ,
1077
- 'sendemail_store_id ' => false ,
1078
- 'extension_attributes ' => false ,
1079
1038
];
1080
1039
1081
1040
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
@@ -1126,11 +1085,11 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1126
1085
$ customerFormMock ->expects ($ this ->once ())
1127
1086
->method ('extractData ' )
1128
1087
->with ($ this ->requestMock , 'customer ' )
1129
- ->willReturn ($ filteredData );
1088
+ ->willReturn ($ extractedData );
1130
1089
$ customerFormMock ->expects ($ this ->once ())
1131
1090
->method ('compactData ' )
1132
- ->with ($ dataToCompact )
1133
- ->willReturn ($ filteredData );
1091
+ ->with ($ extractedData )
1092
+ ->willReturn ($ extractedData );
1134
1093
$ customerFormMock ->expects ($ this ->once ())
1135
1094
->method ('getAttributes ' )
1136
1095
->willReturn ($ attributes );
@@ -1216,19 +1175,10 @@ public function testExecuteWithNewCustomerAndException()
1216
1175
],
1217
1176
'subscription ' => $ subscription ,
1218
1177
];
1219
- $ filteredData = [
1178
+ $ extractedData = [
1220
1179
'coolness ' => false ,
1221
1180
'disable_auto_group_change ' => 'false ' ,
1222
1181
];
1223
- $ dataToCompact = [
1224
- 'coolness ' => false ,
1225
- 'disable_auto_group_change ' => 'false ' ,
1226
- CustomerInterface::DEFAULT_BILLING => false ,
1227
- CustomerInterface::DEFAULT_SHIPPING => false ,
1228
- 'confirmation ' => false ,
1229
- 'sendemail_store_id ' => false ,
1230
- 'extension_attributes ' => false ,
1231
- ];
1232
1182
1233
1183
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
1234
1184
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -1277,11 +1227,11 @@ public function testExecuteWithNewCustomerAndException()
1277
1227
$ customerFormMock ->expects ($ this ->once ())
1278
1228
->method ('extractData ' )
1279
1229
->with ($ this ->requestMock , 'customer ' )
1280
- ->willReturn ($ filteredData );
1230
+ ->willReturn ($ extractedData );
1281
1231
$ customerFormMock ->expects ($ this ->once ())
1282
1232
->method ('compactData ' )
1283
- ->with ($ dataToCompact )
1284
- ->willReturn ($ filteredData );
1233
+ ->with ($ extractedData )
1234
+ ->willReturn ($ extractedData );
1285
1235
$ customerFormMock ->expects ($ this ->once ())
1286
1236
->method ('getAttributes ' )
1287
1237
->willReturn ($ attributes );
0 commit comments