Skip to content

Commit ce889d4

Browse files
author
Michail Slabko
committed
MAGETWO-36828: Api service should not return custom attribute for catalog inventory
- remove unneeded check
1 parent 9c1251f commit ce889d4

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/ProductRepositoryInterfaceTest.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ public function testCatalogInventory()
7070
$returnedQty = $stockItemData[self::KEY_QTY];
7171
$this->assertEquals($qty, $returnedQty, 'UPDATE 1: Expected qty to be same: ' . $qty .', '. $returnedQty);
7272

73-
$customAttributeQty = $this->findCustomAttributeQty();
74-
$this->assertTrue(!is_bool($customAttributeQty), 'Expected to find a quantity in the custom attributes');
75-
$this->assertEquals(
76-
$qty,
77-
$customAttributeQty,
78-
'UPDATE 1: Expected custom attribute qty to be updated: ' . $qty .', '. $customAttributeQty
79-
);
80-
8173
// update the product without any mention of catalog inventory; no change expected for catalog inventory
8274
// note: $qty expected to be the same as previously set, above
8375
$newPrice = $this->getDifferent($response[ProductInterface::PRICE]);
@@ -193,34 +185,6 @@ protected function getDifferent($original)
193185
return 1 + $original * $original;
194186
}
195187

196-
/**
197-
* Returns the product's quantity from the array of custom attributes.
198-
* If no quantity can be found, will return false.
199-
*
200-
* @return int|bool
201-
*/
202-
protected function findCustomAttributeQty()
203-
{
204-
$qty = false;
205-
$qtyAndStockStatus = [];
206-
207-
if (!empty($qtyAndStockStatus) && is_array($qtyAndStockStatus)) {
208-
209-
if (array_key_exists('any_type', $qtyAndStockStatus)) {
210-
// for SOAP, need to use the inner array
211-
$qtyAndStockStatus = $qtyAndStockStatus['any_type'];
212-
}
213-
214-
// ex: [true, 1234]
215-
if (is_bool($qtyAndStockStatus[0]) || is_string($qtyAndStockStatus[0])) {
216-
$qty = $qtyAndStockStatus[1];
217-
} else {
218-
$qty = $qtyAndStockStatus[0];
219-
}
220-
}
221-
return $qty;
222-
}
223-
224188
/**
225189
* Get Simple Product Data
226190
*

0 commit comments

Comments
 (0)