|
2 | 2 | /** |
3 | 3 | * Copyright 2024 Adobe |
4 | 4 | * All Rights Reserved. |
| 5 | + * |
| 6 | + * NOTICE: All information contained herein is, and remains |
| 7 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 8 | + * and technical concepts contained herein are proprietary to Adobe |
| 9 | + * and its suppliers and are protected by all applicable intellectual |
| 10 | + * property laws, including trade secret and copyright laws. |
| 11 | + * Dissemination of this information or reproduction of this material |
| 12 | + * is strictly forbidden unless prior written permission is obtained |
| 13 | + * from Adobe. |
5 | 14 | */ |
6 | 15 | declare(strict_types=1); |
7 | 16 |
|
@@ -193,13 +202,13 @@ public function testAttemptToCancelOrderWithSomeStatuses(string $status, string |
193 | 202 | $this->assertEquals( |
194 | 203 | [ |
195 | 204 | 'requestGuestOrderCancel' => [ |
196 | | - 'errorV2' => [ |
197 | | - 'message' => 'Order already closed, complete, cancelled or on hold' |
198 | | - ], |
199 | | - 'order' => [ |
200 | | - 'status' => $expectedStatus |
201 | | - ] |
| 205 | + 'errorV2' => [ |
| 206 | + 'message' => 'Order already closed, complete, cancelled or on hold' |
| 207 | + ], |
| 208 | + 'order' => [ |
| 209 | + 'status' => $expectedStatus |
202 | 210 | ] |
| 211 | + ] |
203 | 212 | ], |
204 | 213 | $this->graphQlMutation($query) |
205 | 214 | ); |
@@ -236,13 +245,13 @@ public function testAttemptToCancelOrderWithOfflinePaymentFullyInvoicedFullyShip |
236 | 245 | $this->assertEquals( |
237 | 246 | [ |
238 | 247 | 'requestGuestOrderCancel' => [ |
239 | | - 'errorV2' => [ |
240 | | - 'message' => 'Order already closed, complete, cancelled or on hold' |
241 | | - ], |
242 | | - 'order' => [ |
243 | | - 'status' => 'Complete' |
244 | | - ] |
| 248 | + 'errorV2' => [ |
| 249 | + 'message' => 'Order already closed, complete, cancelled or on hold' |
| 250 | + ], |
| 251 | + 'order' => [ |
| 252 | + 'status' => 'Complete' |
245 | 253 | ] |
| 254 | + ] |
246 | 255 | ], |
247 | 256 | $this->graphQlMutation($query) |
248 | 257 | ); |
@@ -292,13 +301,13 @@ public function testAttemptToCancelOrderWithOfflinePaymentFullyInvoicedPartially |
292 | 301 | $this->assertEquals( |
293 | 302 | [ |
294 | 303 | 'requestGuestOrderCancel' => [ |
295 | | - 'errorV2' => [ |
296 | | - 'message' => 'Order with one or more items shipped cannot be cancelled' |
297 | | - ], |
298 | | - 'order' => [ |
299 | | - 'status' => 'Processing' |
300 | | - ] |
| 304 | + 'errorV2' => [ |
| 305 | + 'message' => 'Order with one or more items shipped cannot be cancelled' |
| 306 | + ], |
| 307 | + 'order' => [ |
| 308 | + 'status' => 'Processing' |
301 | 309 | ] |
| 310 | + ] |
302 | 311 | ], |
303 | 312 | $this->graphQlMutation($query) |
304 | 313 | ); |
@@ -335,13 +344,13 @@ public function testAttemptToCancelOrderWithOfflinePaymentFullyInvoicedFullyRefu |
335 | 344 | $this->assertEquals( |
336 | 345 | [ |
337 | 346 | 'requestGuestOrderCancel' => [ |
338 | | - 'errorV2' => [ |
339 | | - 'message' => 'Order already closed, complete, cancelled or on hold' |
340 | | - ], |
341 | | - 'order' => [ |
342 | | - 'status' => 'Closed' |
343 | | - ] |
| 347 | + 'errorV2' => [ |
| 348 | + 'message' => 'Order already closed, complete, cancelled or on hold' |
| 349 | + ], |
| 350 | + 'order' => [ |
| 351 | + 'status' => 'Closed' |
344 | 352 | ] |
| 353 | + ] |
345 | 354 | ], |
346 | 355 | $this->graphQlMutation($query) |
347 | 356 | ); |
@@ -373,11 +382,11 @@ public function testCancelOrderWithOutAnyAmountPaid() |
373 | 382 | $this->assertEquals( |
374 | 383 | [ |
375 | 384 | 'requestGuestOrderCancel' => [ |
376 | | - 'errorV2' => null, |
377 | | - 'order' => [ |
378 | | - 'status' => 'Pending' |
379 | | - ] |
| 385 | + 'errorV2' => null, |
| 386 | + 'order' => [ |
| 387 | + 'status' => 'Pending' |
380 | 388 | ] |
| 389 | + ] |
381 | 390 | ], |
382 | 391 | $this->graphQlMutation($query) |
383 | 392 | ); |
@@ -467,14 +476,14 @@ private function getOrderToken(OrderInterface $order): string |
467 | 476 | return Bootstrap::getObjectManager()->create(Token::class)->encrypt( |
468 | 477 | $order->getIncrementId(), |
469 | 478 | $order->getBillingAddress()->getEmail(), |
470 | | - $order->getBillingAddress()->getLastname() |
| 479 | + $order->getBillingAddress()->getPostcode() |
471 | 480 | ); |
472 | 481 | } |
473 | 482 |
|
474 | 483 | /** |
475 | 484 | * @return array[] |
476 | 485 | */ |
477 | | - public static function orderStatusProvider(): array |
| 486 | + public function orderStatusProvider(): array |
478 | 487 | { |
479 | 488 | return [ |
480 | 489 | 'On Hold status' => [ |
|
0 commit comments