@@ -1060,4 +1060,80 @@ public function customerWithMultiByteDataProvider(): array
1060
1060
],
1061
1061
];
1062
1062
}
1063
+
1064
+ /**
1065
+ * Test customer create with valid name's.
1066
+ *
1067
+ * @param string $fieldName
1068
+ * @param string $fieldValue
1069
+ * @return void
1070
+ *
1071
+ * @dataProvider customerValidNameDataProvider
1072
+ */
1073
+ public function testCreateCustomerWithValidName (string $ fieldName , string $ fieldValue ): void
1074
+ {
1075
+ $ customerData = $ this ->dataObjectProcessor ->buildOutputDataArray (
1076
+ $ this ->customerHelper ->createSampleCustomerDataObject (),
1077
+ Customer::class
1078
+ );
1079
+ $ customerData [$ fieldName ] = $ fieldValue ;
1080
+
1081
+ $ serviceInfo = [
1082
+ 'rest ' => [
1083
+ 'resourcePath ' => self ::RESOURCE_PATH ,
1084
+ 'httpMethod ' => Request::HTTP_METHOD_POST ,
1085
+ ],
1086
+ 'soap ' => [
1087
+ 'service ' => self ::SERVICE_NAME ,
1088
+ 'serviceVersion ' => self ::SERVICE_VERSION ,
1089
+ 'operation ' => self ::SERVICE_NAME . 'Save ' ,
1090
+ ],
1091
+ ];
1092
+
1093
+ $ requestData = ['customer ' => $ customerData ];
1094
+
1095
+ $ response = $ this ->_webApiCall ($ serviceInfo , $ requestData );
1096
+
1097
+ $ this ->assertNotNull ($ response );
1098
+ $ this ->assertEquals ($ fieldValue , $ response [$ fieldName ]);
1099
+ }
1100
+
1101
+ /**
1102
+ * Customer valid name data provider.
1103
+ *
1104
+ * @return array
1105
+ */
1106
+ public function customerValidNameDataProvider (): array
1107
+ {
1108
+ return [
1109
+ [
1110
+ 'firstname ' ,
1111
+ 'Anne-Marie ' ,
1112
+ ],
1113
+ [
1114
+ 'lastname ' ,
1115
+ 'D \'Artagnan ' ,
1116
+ ],
1117
+ [
1118
+ 'lastname ' ,
1119
+ 'Guðmundsdóttir ' ,
1120
+ ],
1121
+ [
1122
+ 'lastname ' ,
1123
+ 'María José Carreño Quiñones ' ,
1124
+ ],
1125
+ [
1126
+ 'lastname ' ,
1127
+ 'Q. Public ' ,
1128
+ ],
1129
+ [
1130
+ 'firstname ' ,
1131
+ 'Elizabeth II ' ,
1132
+ ],
1133
+ [
1134
+ 'firstname ' ,
1135
+ 'X Æ A-12 Musk ' ,
1136
+ ],
1137
+ ];
1138
+ }
1063
1139
}
0 commit comments