@@ -358,9 +358,8 @@ public function testGroupPrices()
358
358
'value ' => 2.10 ,
359
359
];
360
360
$ response [self ::KEY_GROUP_PRICES ] = $ groupPrices ;
361
- $ this ->updateProduct ($ response );
361
+ $ response = $ this ->updateProduct ($ response );
362
362
363
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
364
363
$ this ->assertArrayHasKey (self ::KEY_GROUP_PRICES , $ response );
365
364
$ groupPrices = $ response [self ::KEY_GROUP_PRICES ];
366
365
$ this ->assertNotNull ($ groupPrices , "UPDATE 1: expected to have group prices " );
@@ -373,9 +372,8 @@ public function testGroupPrices()
373
372
// update the product without any mention of group prices; no change expected for group pricing
374
373
$ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
375
374
unset($ response [self ::KEY_GROUP_PRICES ]);
376
- $ this ->updateProduct ($ response );
375
+ $ response = $ this ->updateProduct ($ response );
377
376
378
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
379
377
$ this ->assertArrayHasKey (self ::KEY_GROUP_PRICES , $ response );
380
378
$ groupPrices = $ response [self ::KEY_GROUP_PRICES ];
381
379
$ this ->assertNotNull ($ groupPrices , "UPDATE 2: expected to have group prices " );
@@ -388,10 +386,9 @@ public function testGroupPrices()
388
386
// update the product with empty group prices; expect to have the existing group prices removed
389
387
$ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
390
388
$ response [self ::KEY_GROUP_PRICES ] = [];
391
- $ this ->updateProduct ($ response );
392
-
393
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
394
- $ this ->assertArrayNotHasKey (self ::KEY_GROUP_PRICES , $ response , "expected to not have any 'group_prices' data " );
389
+ $ response = $ this ->updateProduct ($ response );
390
+ $ this ->assertArrayHasKey (self ::KEY_GROUP_PRICES , $ response , "expected to have the 'group_prices' key " );
391
+ $ this ->assertEmpty ($ response [self ::KEY_GROUP_PRICES ], "expected to have an empty array of 'group_prices' " );
395
392
396
393
// delete the product with group prices; expect that all goes well
397
394
$ response = $ this ->deleteProduct ($ productData [ProductInterface::SKU ]);
@@ -440,9 +437,8 @@ public function testTierPrices()
440
437
'qty ' => 12 ,
441
438
];
442
439
$ response [self ::KEY_TIER_PRICES ] = $ tierPrices ;
443
- $ this ->updateProduct ($ response );
440
+ $ response = $ this ->updateProduct ($ response );
444
441
445
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
446
442
$ this ->assertArrayHasKey (self ::KEY_TIER_PRICES , $ response );
447
443
$ tierPrices = $ response [self ::KEY_TIER_PRICES ];
448
444
$ this ->assertNotNull ($ tierPrices , "UPDATE 1: expected to have tier prices " );
@@ -457,9 +453,8 @@ public function testTierPrices()
457
453
// update the product without any mention of tier prices; no change expected for tier pricing
458
454
$ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
459
455
unset($ response [self ::KEY_TIER_PRICES ]);
460
- $ this ->updateProduct ($ response );
456
+ $ response = $ this ->updateProduct ($ response );
461
457
462
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
463
458
$ this ->assertArrayHasKey (self ::KEY_TIER_PRICES , $ response );
464
459
$ tierPrices = $ response [self ::KEY_TIER_PRICES ];
465
460
$ this ->assertNotNull ($ tierPrices , "UPDATE 2: expected to have tier prices " );
@@ -474,10 +469,9 @@ public function testTierPrices()
474
469
// update the product with empty tier prices; expect to have the existing tier prices removed
475
470
$ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
476
471
$ response [self ::KEY_TIER_PRICES ] = [];
477
- $ this ->updateProduct ($ response );
478
-
479
- $ response = $ this ->getProduct ($ productData [ProductInterface::SKU ]);
480
- $ this ->assertArrayNotHasKey (self ::KEY_TIER_PRICES , $ response , "expected to not have any 'tier_prices' data " );
472
+ $ response = $ this ->updateProduct ($ response );
473
+ $ this ->assertArrayHasKey (self ::KEY_TIER_PRICES , $ response , "expected to have the 'tier_prices' key " );
474
+ $ this ->assertEmpty ($ response [self ::KEY_TIER_PRICES ], "expected to have an empty array of 'tier_prices' " );
481
475
482
476
// delete the product with tier prices; expect that all goes well
483
477
$ response = $ this ->deleteProduct ($ productData [ProductInterface::SKU ]);
0 commit comments