@@ -18,6 +18,10 @@ class TierPriceStorageTest extends WebapiAbstract
18
18
private const SERVICE_NAME = 'catalogTierPriceStorageV1 ' ;
19
19
private const SERVICE_VERSION = 'V1 ' ;
20
20
private const SIMPLE_PRODUCT_SKU = 'simple ' ;
21
+ private const CUSTOMER_ALL_GROUPS_NAME ='ALL GROUPS ' ;
22
+ private const CUSTOMER_GENERAL_GROUP_NAME ='General ' ;
23
+ private const CUSTOMER_NOT_LOGGED_IN_GROUP_NAME ='NOT LOGGED IN ' ;
24
+ private const WRONG_CUSTOMER_GROUP_NAME ='general ' ;
21
25
22
26
/**
23
27
* @var \Magento\TestFramework\ObjectManager
@@ -89,15 +93,15 @@ public function testUpdate()
89
93
'price_type ' => TierPriceInterface::PRICE_TYPE_DISCOUNT ,
90
94
'website_id ' => 0 ,
91
95
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
92
- 'customer_group ' => ' ALL GROUPS ' ,
96
+ 'customer_group ' => self :: CUSTOMER_ALL_GROUPS_NAME ,
93
97
'quantity ' => 7778
94
98
];
95
99
$ updatedPrice = [
96
100
'price ' => 778 ,
97
101
'price_type ' => TierPriceInterface::PRICE_TYPE_FIXED ,
98
102
'website_id ' => 0 ,
99
103
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
100
- 'customer_group ' => ' not logged in ' ,
104
+ 'customer_group ' => self :: CUSTOMER_NOT_LOGGED_IN_GROUP_NAME ,
101
105
'quantity ' => $ tierPrice ->getQty ()
102
106
];
103
107
$ response = $ this ->_webApiCall ($ serviceInfo , ['prices ' => [$ updatedPrice , $ newPrice ]]);
@@ -178,15 +182,15 @@ public function testReplaceWithoutErrorMessage()
178
182
'price_type ' => TierPriceInterface::PRICE_TYPE_DISCOUNT ,
179
183
'website_id ' => 0 ,
180
184
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
181
- 'customer_group ' => ' general ' ,
185
+ 'customer_group ' => self :: CUSTOMER_GENERAL_GROUP_NAME ,
182
186
'quantity ' => 7778
183
187
],
184
188
[
185
189
'price ' => 70 ,
186
190
'price_type ' => TierPriceInterface::PRICE_TYPE_FIXED ,
187
191
'website_id ' => 0 ,
188
192
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
189
- 'customer_group ' => ' not logged in ' ,
193
+ 'customer_group ' => self :: CUSTOMER_NOT_LOGGED_IN_GROUP_NAME ,
190
194
'quantity ' => 33
191
195
]
192
196
];
@@ -222,15 +226,15 @@ public function testReplaceWithErrorMessage()
222
226
'price_type ' => TierPriceInterface::PRICE_TYPE_FIXED ,
223
227
'website_id ' => 0 ,
224
228
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
225
- 'customer_group ' => ' general ' ,
229
+ 'customer_group ' => self :: WRONG_CUSTOMER_GROUP_NAME ,
226
230
'quantity ' => 2
227
231
],
228
232
[
229
233
'price ' => 20.62 ,
230
234
'price_type ' => TierPriceInterface::PRICE_TYPE_FIXED ,
231
235
'website_id ' => 0 ,
232
236
'sku ' => self ::SIMPLE_PRODUCT_SKU ,
233
- 'customer_group ' => ' general ' ,
237
+ 'customer_group ' => self :: WRONG_CUSTOMER_GROUP_NAME ,
234
238
'quantity ' => 2
235
239
]
236
240
];
@@ -264,8 +268,8 @@ public function testDelete()
264
268
? TierPriceInterface::PRICE_TYPE_DISCOUNT
265
269
: TierPriceInterface::PRICE_TYPE_FIXED ;
266
270
$ customerGroup = $ tierPrice ->getCustomerGroupId () == \Magento \Customer \Model \Group::NOT_LOGGED_IN_ID
267
- ? ' NOT LOGGED IN '
268
- : ' ALL GROUPS ' ;
271
+ ? self :: CUSTOMER_NOT_LOGGED_IN_GROUP_NAME
272
+ : self :: CUSTOMER_ALL_GROUPS_NAME ;
269
273
$ pricesToDelete [] = [
270
274
'price ' => $ tierPriceValue ,
271
275
'price_type ' => $ priceType ,
0 commit comments