Skip to content

Commit 0740c9d

Browse files
author
Mike Weis
committed
MAGETWO-36840: low_stock_date shows only year when requesting stockItems information of product through API service
- fixed
1 parent 4524f5a commit 0740c9d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ public function getIsDecimalDivided()
239239
}
240240

241241
/**
242-
* @return int Timestamp
242+
* @return string Timestamp
243243
*/
244244
public function getLowStockDate()
245245
{
246-
return (int) $this->_getData(static::LOW_STOCK_DATE);
246+
return $this->_getData(static::LOW_STOCK_DATE);
247247
}
248248

249249
/**

app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,12 @@ public function getStoreIdDataProvider()
395395
[0, $this->storeId],
396396
];
397397
}
398+
399+
public function testGetLowStockDate()
400+
{
401+
// ensure we do *not* return '2015' due to casting to an int
402+
$date = '2015-4-17';
403+
$this->item->setLowStockDate($date);
404+
$this->assertEquals($date, $this->item->getLowStockDate());
405+
}
398406
}

0 commit comments

Comments
 (0)