@@ -302,33 +302,28 @@ 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 ' ,
326
321
'code ' => 'value ' ,
327
322
'coolness ' => false ,
328
323
'region ' => 'region ' ,
329
324
'region_id ' => 'region_id ' ,
330
325
];
331
- $ addressDataToCompact = [
326
+ $ addressCompactedData = [
332
327
'entity_id ' => $ addressId ,
333
328
'default_billing ' => 'true ' ,
334
329
'default_shipping ' => 'true ' ,
@@ -428,11 +423,11 @@ public function testExecuteWithExistentCustomer()
428
423
$ customerFormMock ->expects ($ this ->once ())
429
424
->method ('extractData ' )
430
425
->with ($ this ->requestMock , 'customer ' )
431
- ->willReturn ($ filteredData );
426
+ ->willReturn ($ extractedData );
432
427
$ customerFormMock ->expects ($ this ->once ())
433
428
->method ('compactData ' )
434
- ->with ($ dataToCompact )
435
- ->willReturn ($ filteredData );
429
+ ->with ($ extractedData )
430
+ ->willReturn ($ compactedData );
436
431
$ customerFormMock ->expects ($ this ->once ())
437
432
->method ('getAttributes ' )
438
433
->willReturn ($ attributes );
@@ -443,11 +438,11 @@ public function testExecuteWithExistentCustomer()
443
438
$ customerAddressFormMock ->expects ($ this ->once ())
444
439
->method ('extractData ' )
445
440
->with ($ this ->requestMock , 'address/ ' . $ addressId )
446
- ->willReturn ($ addressFilteredData );
441
+ ->willReturn ($ addressExtractedData );
447
442
$ customerAddressFormMock ->expects ($ this ->once ())
448
443
->method ('compactData ' )
449
- ->with ($ addressDataToCompact )
450
- ->willReturn ($ addressFilteredData );
444
+ ->with ($ addressExtractedData )
445
+ ->willReturn ($ addressCompactedData );
451
446
$ customerAddressFormMock ->expects ($ this ->once ())
452
447
->method ('getAttributes ' )
453
448
->willReturn ($ attributes );
@@ -635,33 +630,13 @@ public function testExecuteWithNewCustomer()
635
630
],
636
631
'subscription ' => $ subscription ,
637
632
];
638
- $ filteredData = [
633
+ $ extractedData = [
639
634
'coolness ' => false ,
640
635
'disable_auto_group_change ' => 'false ' ,
641
636
];
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 = [
637
+ $ addressExtractedData = [
652
638
'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 ' ,
639
+ 'code ' => 'value ' ,
665
640
'coolness ' => false ,
666
641
'region ' => 'region ' ,
667
642
'region_id ' => 'region_id ' ,
@@ -739,11 +714,11 @@ public function testExecuteWithNewCustomer()
739
714
$ customerFormMock ->expects ($ this ->once ())
740
715
->method ('extractData ' )
741
716
->with ($ this ->requestMock , 'customer ' )
742
- ->willReturn ($ filteredData );
717
+ ->willReturn ($ extractedData );
743
718
$ customerFormMock ->expects ($ this ->once ())
744
719
->method ('compactData ' )
745
- ->with ($ dataToCompact )
746
- ->willReturn ($ filteredData );
720
+ ->with ($ extractedData )
721
+ ->willReturn ($ extractedData );
747
722
$ customerFormMock ->expects ($ this ->once ())
748
723
->method ('getAttributes ' )
749
724
->willReturn ($ attributes );
@@ -754,11 +729,11 @@ public function testExecuteWithNewCustomer()
754
729
$ customerAddressFormMock ->expects ($ this ->once ())
755
730
->method ('extractData ' )
756
731
->with ($ this ->requestMock , 'address/ ' . $ addressId )
757
- ->willReturn ($ addressFilteredData );
732
+ ->willReturn ($ addressExtractedData );
758
733
$ customerAddressFormMock ->expects ($ this ->once ())
759
734
->method ('compactData ' )
760
- ->with ($ addressDataToCompact )
761
- ->willReturn ($ addressFilteredData );
735
+ ->with ($ addressExtractedData )
736
+ ->willReturn ($ addressExtractedData );
762
737
$ customerAddressFormMock ->expects ($ this ->once ())
763
738
->method ('getAttributes ' )
764
739
->willReturn ($ attributes );
@@ -912,19 +887,10 @@ public function testExecuteWithNewCustomerAndValidationException()
912
887
],
913
888
'subscription ' => $ subscription ,
914
889
];
915
- $ filteredData = [
890
+ $ extractedData = [
916
891
'coolness ' => false ,
917
892
'disable_auto_group_change ' => 'false ' ,
918
893
];
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
894
929
895
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
930
896
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -973,11 +939,11 @@ public function testExecuteWithNewCustomerAndValidationException()
973
939
$ customerFormMock ->expects ($ this ->once ())
974
940
->method ('extractData ' )
975
941
->with ($ this ->requestMock , 'customer ' )
976
- ->willReturn ($ filteredData );
942
+ ->willReturn ($ extractedData );
977
943
$ customerFormMock ->expects ($ this ->once ())
978
944
->method ('compactData ' )
979
- ->with ($ dataToCompact )
980
- ->willReturn ($ filteredData );
945
+ ->with ($ extractedData )
946
+ ->willReturn ($ extractedData );
981
947
$ customerFormMock ->expects ($ this ->once ())
982
948
->method ('getAttributes ' )
983
949
->willReturn ($ attributes );
@@ -1064,18 +1030,9 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1064
1030
],
1065
1031
'subscription ' => $ subscription ,
1066
1032
];
1067
- $ filteredData = [
1068
- 'coolness ' => false ,
1069
- 'disable_auto_group_change ' => 'false ' ,
1070
- ];
1071
- $ dataToCompact = [
1033
+ $ extractedData = [
1072
1034
'coolness ' => false ,
1073
1035
'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
1036
];
1080
1037
1081
1038
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
@@ -1126,11 +1083,11 @@ public function testExecuteWithNewCustomerAndLocalizedException()
1126
1083
$ customerFormMock ->expects ($ this ->once ())
1127
1084
->method ('extractData ' )
1128
1085
->with ($ this ->requestMock , 'customer ' )
1129
- ->willReturn ($ filteredData );
1086
+ ->willReturn ($ extractedData );
1130
1087
$ customerFormMock ->expects ($ this ->once ())
1131
1088
->method ('compactData ' )
1132
- ->with ($ dataToCompact )
1133
- ->willReturn ($ filteredData );
1089
+ ->with ($ extractedData )
1090
+ ->willReturn ($ extractedData );
1134
1091
$ customerFormMock ->expects ($ this ->once ())
1135
1092
->method ('getAttributes ' )
1136
1093
->willReturn ($ attributes );
@@ -1216,19 +1173,10 @@ public function testExecuteWithNewCustomerAndException()
1216
1173
],
1217
1174
'subscription ' => $ subscription ,
1218
1175
];
1219
- $ filteredData = [
1176
+ $ extractedData = [
1220
1177
'coolness ' => false ,
1221
1178
'disable_auto_group_change ' => 'false ' ,
1222
1179
];
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
1180
1233
1181
/** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */
1234
1182
$ attributeMock = $ this ->getMockBuilder ('Magento\Customer\Api\Data\AttributeMetadataInterface ' )
@@ -1277,11 +1225,11 @@ public function testExecuteWithNewCustomerAndException()
1277
1225
$ customerFormMock ->expects ($ this ->once ())
1278
1226
->method ('extractData ' )
1279
1227
->with ($ this ->requestMock , 'customer ' )
1280
- ->willReturn ($ filteredData );
1228
+ ->willReturn ($ extractedData );
1281
1229
$ customerFormMock ->expects ($ this ->once ())
1282
1230
->method ('compactData ' )
1283
- ->with ($ dataToCompact )
1284
- ->willReturn ($ filteredData );
1231
+ ->with ($ extractedData )
1232
+ ->willReturn ($ extractedData );
1285
1233
$ customerFormMock ->expects ($ this ->once ())
1286
1234
->method ('getAttributes ' )
1287
1235
->willReturn ($ attributes );
0 commit comments