Skip to content

Commit e9e8ea5

Browse files
Merge remote-tracking branch 'origin/MC-34988' into 2.4-develop-pr34
2 parents fbd96ec + 4ae2921 commit e9e8ea5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,35 @@ public function testGet()
6868
$this->assertEquals($product->getSpecialPrice(), $response[0]['price']);
6969
}
7070

71+
/**
72+
* Test get method when special price is 0.
73+
*
74+
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
75+
*/
76+
public function testGetZeroValue()
77+
{
78+
$specialPrice = 0;
79+
$productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
80+
$product = $productRepository->get(self::SIMPLE_PRODUCT_SKU, true);
81+
$product->setData('special_price', $specialPrice);
82+
$productRepository->save($product);
83+
84+
$serviceInfo = [
85+
'rest' => [
86+
'resourcePath' => '/V1/products/special-price-information',
87+
'httpMethod' => Request::HTTP_METHOD_POST
88+
],
89+
'soap' => [
90+
'service' => self::SERVICE_NAME,
91+
'serviceVersion' => self::SERVICE_VERSION,
92+
'operation' => self::SERVICE_NAME . 'Get',
93+
],
94+
];
95+
$response = $this->_webApiCall($serviceInfo, ['skus' => [self::SIMPLE_PRODUCT_SKU]]);
96+
$this->assertNotEmpty($response);
97+
$this->assertEquals($specialPrice, $response[0]['price']);
98+
}
99+
71100
/**
72101
* Test update method.
73102
*

0 commit comments

Comments
 (0)