Skip to content

Commit 1cb8a98

Browse files
committed
ACP2E-3091: [Cloud] Creating the Duplicate website group price customer group in Tier Prices Api.
1 parent afa2a04 commit 1cb8a98

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

dev/tests/api-functional/testsuite/Magento/Catalog/Api/TierPriceStorageTest.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,53 @@ public function testCheckWebsite()
354354
}
355355
}
356356

357+
/**
358+
* Test replace method.
359+
*
360+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
361+
*/
362+
public function testCheckNewRecords()
363+
{
364+
$serviceInfo = [
365+
'rest' => [
366+
'resourcePath' => '/V1/products/tier-prices',
367+
'httpMethod' => Request::HTTP_METHOD_POST
368+
],
369+
'soap' => [
370+
'service' => self::SERVICE_NAME,
371+
'serviceVersion' => self::SERVICE_VERSION,
372+
'operation' => self::SERVICE_NAME . 'Update',
373+
],
374+
];
375+
376+
$newPrices = [
377+
[
378+
'price' => 10.31,
379+
'price_type' => TierPriceInterface::PRICE_TYPE_FIXED,
380+
'website_id' => 0,
381+
'sku' => self::SIMPLE_PRODUCT_SKU,
382+
'customer_group' => self::WRONG_CUSTOMER_GROUP_NAME,
383+
'quantity' => 2
384+
],
385+
[
386+
'price' => 20.62,
387+
'price_type' => TierPriceInterface::PRICE_TYPE_FIXED,
388+
'website_id' => 1,
389+
'sku' => self::SIMPLE_PRODUCT_SKU,
390+
'customer_group' => self::WRONG_CUSTOMER_GROUP_NAME,
391+
'quantity' => 2
392+
]
393+
];
394+
395+
$response = $this->_webApiCall($serviceInfo, ['prices' => $newPrices]);
396+
$this->assertNotEmpty($response);
397+
$message = 'We found a duplicate website, tier price, customer group and quantity: '
398+
. 'Customer Group = %customerGroup, Website ID = %websiteId, Quantity = %qty. '
399+
. 'Row ID: SKU = %SKU, Website ID: %websiteId, Customer Group: %customerGroup, Quantity: %qty.';
400+
$this->assertEquals($message, $response[0]['message']);
401+
$this->assertEquals('simple', $response[0]['parameters'][0]);
402+
}
403+
357404
/**
358405
* Check prise exists and is correct.
359406
*

0 commit comments

Comments
 (0)