24 $productSku =
'simple';
27 'resourcePath' => self::RESOURCE_PATH . $productSku .
'/group-prices/' . $customerGroupId .
'/tiers',
33 'operation' => self::SERVICE_NAME .
'GetList',
39 [
'sku' => $productSku,
'customerGroupId' => $customerGroupId]
42 $this->assertCount(
$count, $tearPriceList);
44 $this->assertEquals(
$value, $tearPriceList[0][
'value']);
45 $this->assertEquals($qty, $tearPriceList[0][
'qty']);
66 $productSku =
'simple';
69 'resourcePath' => self::RESOURCE_PATH
70 . $productSku .
"/group-prices/" . $customerGroupId .
"/tiers/" . $qty,
76 'operation' => self::SERVICE_NAME .
'Remove',
79 $requestData = [
'sku' => $productSku,
'customerGroupId' => $customerGroupId,
'qty' => $qty];
86 'delete_tier_price_for_specific_customer_group' => [0, 3],
87 'delete_tier_price_for_all_customer_group' => [
'all', 5]
95 public function testAdd()
97 $productSku =
'simple';
103 'resourcePath' =>
'/V1/products/' . $productSku
104 .
'/group-prices/' . $customerGroupId .
'/tiers/' . $qty .
'/price/' .
$price,
110 'operation' => self::SERVICE_NAME .
'Add',
115 'sku' => $productSku,
116 'customerGroupId' => $customerGroupId,
125 $this->assertCount(1,
$prices);
126 $this->assertEquals(10,
$prices[0]->getValue());
127 $this->assertEquals(50,
$prices[0]->getQty());
134 public function testAddWithAllCustomerGrouped()
136 $productSku =
'simple';
137 $customerGroupId =
'all';
142 'resourcePath' =>
'/V1/products/' . $productSku
143 .
'/group-prices/' . $customerGroupId .
'/tiers/' . $qty .
'/price/' .
$price,
149 'operation' => self::SERVICE_NAME .
'Add',
153 'sku' => $productSku,
154 'customerGroupId' => $customerGroupId,
163 $this->assertCount(3,
$prices);
164 $this->assertEquals(20, (
int)
$prices[2]->getValue());
165 $this->assertEquals(50, (
int)
$prices[2]->getQty());
172 public function testUpdateWithAllGroups()
174 $productSku =
'simple';
175 $customerGroupId =
'all';
180 'resourcePath' =>
'/V1/products/' . $productSku
181 .
'/group-prices/' . $customerGroupId .
'/tiers/' . $qty .
'/price/' .
$price,
187 'operation' => self::SERVICE_NAME .
'Add',
191 'sku' => $productSku,
192 'customerGroupId' => $customerGroupId,
201 $this->assertCount(2,
$prices);
202 $this->assertEquals(20, (
int)
$prices[0]->getValue());
203 $this->assertEquals(2, (
int)
$prices[0]->getQty());
_webApiCall( $serviceInfo, $arguments=[], $webApiAdapterCode=null, $storeCode=null, $integration=null)
testDelete($customerGroupId, $qty)
testGetList($customerGroupId, $count, $value, $qty)