File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
dev/tests/api-functional/testsuite/Magento/Catalog/Api Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments