Skip to content

Commit 126f4ff

Browse files
author
Yu Tang
committed
Merge branch 'FearlessKiwis-MAGETWO-36840-low-stock-date' into develop
2 parents 1de3514 + 04cc382 commit 126f4ff

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
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
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function saveStockItemBySkuWithWrongInputDataProvider()
223223
'enable_qty_increments' => '',
224224
'use_config_manage_stock' => 1,
225225
'manage_stock' => 1,
226-
'low_stock_date' => 0,
226+
'low_stock_date' => '',
227227
'is_decimal_divided' => '',
228228
'stock_status_changed_auto' => 0
229229
],

0 commit comments

Comments
 (0)