Skip to content

Commit d5c4191

Browse files
committed
add changes to test
1 parent 457b0ea commit d5c4191

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testGetCorrectDisplaingTierPriceForProducts()
128128
{
129129
products(search: "{$productSku}") {
130130
items {
131-
id
131+
sku
132132
name
133133
price_tiers {
134134
quantity
@@ -141,10 +141,14 @@ public function testGetCorrectDisplaingTierPriceForProducts()
141141
}
142142
QUERY;
143143
$response = $this->graphQlQuery($query);
144-
$this->assertCount(0, $response['products']['items'][0]['price_tiers']);
145-
$this->assertCount(1, $response['products']['items'][1]['price_tiers']);
146-
$this->assertCount(1, $response['products']['items'][2]['price_tiers']);
147-
$this->assertCount(1, $response['products']['items'][3]['price_tiers']);
144+
foreach ($response['products']['items'] as $key => $item) {
145+
if ($item['sku'] == 'simple_19') {
146+
$this->assertCount(0, $response['products']['items'][$key]['price_tiers']);
147+
}
148+
if (in_array($item['sku'], ['simple_1','simple_2','simple_3'])) {
149+
$this->assertCount(1, $response['products']['items'][$key]['price_tiers']);
150+
}
151+
}
148152
}
149153

150154
/**

dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_without_tier_price.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
$product->setTypeId(Type::TYPE_SIMPLE)
2727
->setAttributeSetId($product->getDefaultAttributeSetId())
2828
->setWebsiteIds([1])
29-
->setName('Simple Product ' . 10)
30-
->setSku('simple_10')
29+
->setName('Simple Product 19')
30+
->setSku('simple_19')
3131
->setPrice(22)
3232
->setWeight(1)
3333
->setVisibility(Visibility::VISIBILITY_BOTH)

dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_without_tier_price_rollback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/** @var ProductRepositoryInterface $productRepository */
2222
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
2323
try {
24-
$product = $productRepository->get('simple_10', false, null, true);
24+
$product = $productRepository->get('simple_19', false, null, true);
2525
$productRepository->delete($product);
2626
} catch (NoSuchEntityException $e) {
2727
}

0 commit comments

Comments
 (0)