Skip to content

Commit 77be706

Browse files
committed
Fix Tests
1 parent b2a3551 commit 77be706

9 files changed

+92
-23
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ProductRepositoryPriceModeWebsiteChangePriceTest extends WebapiAbstract
1313
{
1414
const SERVICE_NAME = 'catalogProductRepositoryV1';
15+
const PRICE_SERVICE_NAME = 'catalogBasePriceStorageV1';
1516
const SERVICE_VERSION = 'V1';
1617
const PRODUCTS_RESOURCE_PATH = '/V1/products';
1718
const PRICES_RESOURCE_PATH = '/V1/products/base-prices';
@@ -61,6 +62,11 @@ public function testChangePriceForStore()
6162
'rest' => [
6263
'resourcePath' => self::PRICES_RESOURCE_PATH,
6364
'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST
65+
],
66+
'soap' => [
67+
'service' => self::PRICE_SERVICE_NAME,
68+
'serviceVersion' => self::SERVICE_VERSION,
69+
'operation' => self::PRICE_SERVICE_NAME . 'Update',
6470
]
6571
];
6672

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testDelete($customerGroupId, $qty)
8282
],
8383
];
8484
$requestData = ['sku' => $productSku, 'customerGroupId' => $customerGroupId, 'qty' => $qty];
85-
$this->assertTrue($this->_webApiCall($serviceInfo, $requestData));
85+
$this->assertTrue($this->_webApiCall($serviceInfo, $requestData, null, "all"));
8686
}
8787

8888
public function deleteDataProvider()
@@ -198,7 +198,7 @@ public function testUpdateWithAllGroups()
198198
'qty' => $qty,
199199
'price' => $price,
200200
];
201-
$this->_webApiCall($serviceInfo, $requestData);
201+
$this->_webApiCall($serviceInfo, $requestData, null, "all");
202202
$objectManager = \Magento\TestFramework\ObjectManager::getInstance();
203203
/** @var \Magento\Catalog\Api\ProductTierPriceManagementInterface $service */
204204
$service = $objectManager->get(\Magento\Catalog\Api\ProductTierPriceManagementInterface::class);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function testUpdate(array $data)
148148
* Delete special price for specified store when price scope is global
149149
*
150150
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
151-
*
151+
* @magentoConfigFixture default_store catalog/price/scope 0
152152
* @return void
153153
*/
154154
public function testDeleteWhenPriceIsGlobal(): void

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ protected function setUp(): void
3333
* Test get method.
3434
*
3535
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
36+
* @magentoConfigFixture default_store catalog/price/scope 0
3637
*/
3738
public function testGet()
3839
{
@@ -53,7 +54,6 @@ public function testGet()
5354
$tierPrices = $productRepository->get(self::SIMPLE_PRODUCT_SKU)->getTierPrices();
5455
$this->assertNotEmpty($response);
5556
$this->assertEquals(count($response), count($tierPrices));
56-
5757
foreach ($response as $item) {
5858
$this->assertTrue($this->isPriceCorrect($item, $tierPrices));
5959
}
@@ -63,6 +63,7 @@ public function testGet()
6363
* Test update method.
6464
*
6565
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
66+
* @magentoConfigFixture default_store catalog/price/scope 0
6667
*/
6768
public function testUpdate()
6869
{
@@ -252,7 +253,6 @@ public function testDelete()
252253
private function isPriceCorrect(array $price, array $tierPrices)
253254
{
254255
$isCorrect = false;
255-
256256
foreach ($tierPrices as $tierPrice) {
257257
$priceIsCorrect = $price['price_type'] === \Magento\Catalog\Api\Data\TierPriceInterface::PRICE_TYPE_DISCOUNT
258258
? (float)$tierPrice->getExtensionAttributes()->getPercentageValue() === (float)$price['price']
@@ -265,7 +265,6 @@ private function isPriceCorrect(array $price, array $tierPrices)
265265
break;
266266
}
267267
}
268-
269268
return $isCorrect;
270269
}
271270
}

dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_bundle_shipped_separately.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
'selection_qty' => 1,
8181
'selection_can_change_qty' => 1,
8282
'delete' => '',
83-
'selection_price_type' => 0
83+
'selection_price_type' => 0,
84+
'selection_price_value' => 5
8485
],
8586
],
8687
[
@@ -89,7 +90,8 @@
8990
'selection_qty' => 1,
9091
'selection_can_change_qty' => 1,
9192
'delete' => '',
92-
'selection_price_type' => 0
93+
'selection_price_type' => 0,
94+
'selection_price_value' => 5
9395
],
9496
],
9597
],
@@ -116,6 +118,8 @@
116118
if (isset($linkData['selection_can_change_qty'])) {
117119
$link->setCanChangeQuantity($linkData['selection_can_change_qty']);
118120
}
121+
$link->setPriceType($linkData['selection_price_type']);
122+
$link->setPrice($linkData['selection_price_value']);
119123
$links[] = $link;
120124
}
121125
}

dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_bundle_shipped_together.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
'selection_qty' => 1,
8181
'selection_can_change_qty' => 1,
8282
'delete' => '',
83+
'selection_price_type' => 0,
84+
'selection_price_value' => 5
8385
],
8486
],
8587
[
@@ -88,6 +90,8 @@
8890
'selection_qty' => 1,
8991
'selection_can_change_qty' => 1,
9092
'delete' => '',
93+
'selection_price_type' => 0,
94+
'selection_price_value' => 5
9195
],
9296
],
9397
],
@@ -114,6 +118,8 @@
114118
if (isset($linkData['selection_can_change_qty'])) {
115119
$link->setCanChangeQuantity($linkData['selection_can_change_qty']);
116120
}
121+
$link->setPriceType($linkData['selection_price_type']);
122+
$link->setPrice($linkData['selection_price_value']);
117123
$links[] = $link;
118124
}
119125
}

dev/tests/integration/testsuite/Magento/Bundle/_files/product.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
'selection_qty' => 1,
5757
'selection_can_change_qty' => 1,
5858
'delete' => '',
59-
59+
'selection_price_type' => 0
6060
],
6161
],
6262
]
@@ -86,6 +86,8 @@
8686
if (isset($linkData['selection_can_change_qty'])) {
8787
$link->setCanChangeQuantity($linkData['selection_can_change_qty']);
8888
}
89+
$link->setPriceType($linkData['selection_price_type']);
90+
$link->setPrice($linkData['selection_price_value']);
8991
$links[] = $link;
9092
}
9193
}

dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_multiple_options.php

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,18 @@
9797
'selection_qty' => 1,
9898
'selection_can_change_qty' => 1,
9999
'delete' => '',
100-
'option_id' => 1
100+
'option_id' => 1,
101+
'selection_price_type' => 0,
102+
'selection_price_value' => 5
101103
],
102104
[
103105
'product_id' => 11,
104106
'selection_qty' => 1,
105107
'selection_can_change_qty' => 1,
106108
'delete' => '',
107-
'option_id' => 1
109+
'option_id' => 1,
110+
'selection_price_type' => 0,
111+
'selection_price_value' => 5
108112
]
109113
],
110114
[
@@ -113,56 +117,72 @@
113117
'selection_qty' => 1,
114118
'selection_can_change_qty' => 1,
115119
'delete' => '',
116-
'option_id' => 2
120+
'option_id' => 2,
121+
'selection_price_type' => 0,
122+
'selection_price_value' => 5
117123
],
118124
[
119125
'product_id' => 11,
120126
'selection_qty' => 1,
121127
'selection_can_change_qty' => 1,
122128
'delete' => '',
123-
'option_id' => 2
129+
'option_id' => 2,
130+
'selection_price_type' => 0,
131+
'selection_price_value' => 5
124132
]
125133
],
126134
[
127135
[
128136
'product_id' => 10,
129137
'selection_qty' => 1,
130138
'delete' => '',
131-
'option_id' => 3
139+
'option_id' => 3,
140+
'selection_price_type' => 0,
141+
'selection_price_value' => 5
132142
],
133143
[
134144
'product_id' => 11,
135145
'selection_qty' => 1,
136146
'delete' => '',
137-
'option_id' => 3
147+
'option_id' => 3,
148+
'selection_price_type' => 0,
149+
'selection_price_value' => 5
138150
]
139151
],
140152
[
141153
[
142154
'product_id' => 10,
143155
'selection_qty' => 1,
144156
'delete' => '',
145-
'option_id' => 4
157+
'option_id' => 4,
158+
'selection_price_type' => 0,
159+
'selection_price_value' => 5
146160
],
147161
[
148162
'product_id' => 11,
149163
'selection_qty' => 1,
150164
'delete' => '',
151-
'option_id' => 4
165+
'option_id' => 4,
166+
'selection_price_type' => 0,
167+
'selection_price_value' => 5
152168
]
153169
],
154170
[
155171
[
156172
'product_id' => 10,
157173
'selection_qty' => 1,
158174
'delete' => '',
159-
'option_id' => 5
175+
'option_id' => 5,
176+
'selection_price_type' => 0,
177+
'selection_price_value' => 5
160178
],
161179
[
162180
'product_id' => 11,
163181
'selection_qty' => 1,
164182
'delete' => '',
165-
'option_id' => 5
183+
'option_id' => 5,
184+
'selection_price_type' => 0,
185+
'selection_price_value' => 5
166186
]
167187
]
168188
]
@@ -188,6 +208,8 @@
188208
$linkProduct = $productRepository->getById($linkData['product_id']);
189209
$link->setSku($linkProduct->getSku());
190210
$link->setQty($linkData['selection_qty']);
211+
$link->setPriceType($linkData['selection_price_type']);
212+
$link->setPrice($linkData['selection_price_value']);
191213
$links[] = $link;
192214
}
193215
}

dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,40 @@
6666
)->setBundleSelectionsData(
6767
[
6868
[
69-
['product_id' => 10, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''],
70-
['product_id' => 11, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''],
69+
[
70+
'product_id' => 10,
71+
'selection_qty' => 1,
72+
'selection_can_change_qty' => 1,
73+
'delete' => '',
74+
'selection_price_type' => 0,
75+
'selection_price_value' => 5
76+
],
77+
[
78+
'product_id' => 11,
79+
'selection_qty' => 1,
80+
'selection_can_change_qty' => 1,
81+
'delete' => '',
82+
'selection_price_type' => 0,
83+
'selection_price_value' => 5
84+
],
7185
],
7286
[
73-
['product_id' => 12, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''],
74-
['product_id' => 13, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''],
87+
[
88+
'product_id' => 12,
89+
'selection_qty' => 1,
90+
'selection_can_change_qty' => 1,
91+
'delete' => '',
92+
'selection_price_type' => 0,
93+
'selection_price_value' => 5
94+
],
95+
[
96+
'product_id' => 13,
97+
'selection_qty' => 1,
98+
'selection_can_change_qty' => 1,
99+
'delete' => '',
100+
'selection_price_type' => 0,
101+
'selection_price_value' => 5
102+
],
75103
],
76104
]
77105
);
@@ -99,6 +127,8 @@
99127
$linkProduct = $productRepository->getById($linkData['product_id']);
100128
$link->setSku($linkProduct->getSku());
101129
$link->setQty($linkData['selection_qty']);
130+
$link->setPriceType($linkData['selection_price_type']);
131+
$link->setPrice($linkData['selection_price_value']);
102132
$links[] = $link;
103133
}
104134
}

0 commit comments

Comments
 (0)