Skip to content

Commit

Permalink
Specify date fixture and fix expectations
Browse files Browse the repository at this point in the history
* Fix date_format expectation for month part
* Make test independent of current time
  • Loading branch information
Vinai committed Jan 5, 2015
1 parent e4b6347 commit 1d7b54a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ public function testGetValue(array $data, $expect)
*/
public function getValueDataProvider()
{
$currentTime = time();
$testTimestamp = strtotime('2014-05-18 12:08:16');
return [
[
[
'date_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
'time_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
'value' => $currentTime,
'value' => $testTimestamp,
],
date('m/j/y g:i A', $currentTime),
date('n/j/y g:i A', $testTimestamp),
],
[
[
'time_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
'value' => $currentTime,
'value' => $testTimestamp,
],
date('g:i A', $currentTime)
date('g:i A', $testTimestamp)
],
[
[
'date_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
'value' => $currentTime,
'value' => $testTimestamp,
],
date('m/j/y', $currentTime)
date('n/j/y', $testTimestamp)
]
];
}
Expand Down

0 comments on commit 1d7b54a

Please sign in to comment.