@@ -134,52 +134,6 @@ public function testSaveAddressInformationWithInvalidFieldLengths()
134
134
$ this ->callSaveAddressInformation ($ cartId , $ shippingInformation );
135
135
}
136
136
137
- /**
138
- * Test validation of invalid email format
139
- *
140
- * @magentoApiDataFixture Magento/Sales/_files/quote.php
141
- */
142
- public function testSaveAddressInformationWithInvalidEmail ()
143
- {
144
- $ this ->expectException (\Exception::class);
145
- $ this ->expectExceptionMessage ('The address failed to save. Verify the address and try again. ' );
146
- $ cartId = $ this ->getMaskedCartId ('test01 ' );
147
- $ shippingAddress = $ this ->addressFactory ->create ();
148
- $ shippingAddress ->setData ([
149
- 'firstname ' => 'John ' ,
150
- 'lastname ' => 'Doe ' ,
151
- 'email ' => 'invalid-email-format ' ,
152
- 'country_id ' => 'US ' ,
153
- 'region_id ' => 12 ,
154
- 'region ' => 'California ' ,
155
- 'region_code ' => 'CA ' ,
156
- 'street ' => ['123 Test Street ' ],
157
- 'city ' => 'Test City ' ,
158
- 'postcode ' => '90210 ' ,
159
- 'telephone ' => '1234567890 ' ,
160
- ]);
161
- $ billingAddress = $ this ->addressFactory ->create ();
162
- $ billingAddress ->setData ([
163
- 'firstname ' => 'John ' ,
164
- 'lastname ' => 'Doe ' ,
165
- 'email ' => 'invalid-email-format ' ,
166
- 'country_id ' => 'US ' ,
167
- 'region_id ' => 12 ,
168
- 'region ' => 'California ' ,
169
- 'region_code ' => 'CA ' ,
170
- 'street ' => ['123 Test Street ' ],
171
- 'city ' => 'Test City ' ,
172
- 'postcode ' => '90210 ' ,
173
- 'telephone ' => '1234567890 ' ,
174
- ]);
175
- $ shippingInformation = $ this ->shippingInformationFactory ->create ();
176
- $ shippingInformation ->setShippingAddress ($ shippingAddress );
177
- $ shippingInformation ->setBillingAddress ($ billingAddress );
178
- $ shippingInformation ->setShippingMethodCode ('flatrate ' );
179
- $ shippingInformation ->setShippingCarrierCode ('flatrate ' );
180
- $ this ->callSaveAddressInformation ($ cartId , $ shippingInformation );
181
- }
182
-
183
137
/**
184
138
* Test successful validation with valid address data
185
139
*
@@ -227,52 +181,6 @@ public function testSaveAddressInformationWithValidData()
227
181
$ this ->assertArrayHasKey ('totals ' , $ result );
228
182
}
229
183
230
- /**
231
- * Test validation of invalid country code
232
- *
233
- * @magentoApiDataFixture Magento/Sales/_files/quote.php
234
- */
235
- public function testSaveAddressInformationWithInvalidCountry ()
236
- {
237
- $ this ->expectException (\Exception::class);
238
- $ this ->expectExceptionMessage ('The address failed to save. Verify the address and try again. ' );
239
- $ cartId = $ this ->getMaskedCartId ('test01 ' );
240
- $ shippingAddress = $ this ->addressFactory ->create ();
241
- $ shippingAddress ->setData ([
242
- 'firstname ' => 'John ' ,
243
- 'lastname ' => 'Doe ' ,
244
-
245
- 'country_id ' => 'INVALID_COUNTRY ' ,
246
- 'region_id ' => 12 ,
247
- 'region ' => 'California ' ,
248
- 'region_code ' => 'CA ' ,
249
- 'street ' => ['123 Test Street ' ],
250
- 'city ' => 'Test City ' ,
251
- 'postcode ' => '90210 ' ,
252
- 'telephone ' => '1234567890 ' ,
253
- ]);
254
- $ billingAddress = $ this ->addressFactory ->create ();
255
- $ billingAddress ->setData ([
256
- 'firstname ' => 'John ' ,
257
- 'lastname ' => 'Doe ' ,
258
-
259
- 'country_id ' => 'INVALID_COUNTRY ' ,
260
- 'region_id ' => 12 ,
261
- 'region ' => 'California ' ,
262
- 'region_code ' => 'CA ' ,
263
- 'street ' => ['123 Test Street ' ],
264
- 'city ' => 'Test City ' ,
265
- 'postcode ' => '90210 ' ,
266
- 'telephone ' => '1234567890 ' ,
267
- ]);
268
- $ shippingInformation = $ this ->shippingInformationFactory ->create ();
269
- $ shippingInformation ->setShippingAddress ($ shippingAddress );
270
- $ shippingInformation ->setBillingAddress ($ billingAddress );
271
- $ shippingInformation ->setShippingMethodCode ('flatrate ' );
272
- $ shippingInformation ->setShippingCarrierCode ('flatrate ' );
273
- $ this ->callSaveAddressInformation ($ cartId , $ shippingInformation );
274
- }
275
-
276
184
/**
277
185
* Get masked cart ID for the given quote
278
186
*
@@ -298,8 +206,7 @@ private function getMaskedCartId(string $reservedOrderId): string
298
206
private function callSaveAddressInformation (
299
207
string $ cartId ,
300
208
ShippingInformationInterface $ shippingInformation
301
- ): array
302
- {
209
+ ): array {
303
210
$ serviceInfo = [
304
211
'rest ' => [
305
212
'resourcePath ' => sprintf (self ::RESOURCE_PATH , $ cartId ),
0 commit comments