Skip to content

Commit 1d7b54a

Browse files
committed
Specify date fixture and fix expectations
* Fix date_format expectation for month part * Make test independent of current time
1 parent e4b6347 commit 1d7b54a

File tree

1 file changed

+7
-7
lines changed
  • dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element

1 file changed

+7
-7
lines changed

dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ public function testGetValue(array $data, $expect)
4848
*/
4949
public function getValueDataProvider()
5050
{
51-
$currentTime = time();
51+
$testTimestamp = strtotime('2014-05-18 12:08:16');
5252
return [
5353
[
5454
[
5555
'date_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
5656
'time_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
57-
'value' => $currentTime,
57+
'value' => $testTimestamp,
5858
],
59-
date('m/j/y g:i A', $currentTime),
59+
date('n/j/y g:i A', $testTimestamp),
6060
],
6161
[
6262
[
6363
'time_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
64-
'value' => $currentTime,
64+
'value' => $testTimestamp,
6565
],
66-
date('g:i A', $currentTime)
66+
date('g:i A', $testTimestamp)
6767
],
6868
[
6969
[
7070
'date_format' => \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT,
71-
'value' => $currentTime,
71+
'value' => $testTimestamp,
7272
],
73-
date('m/j/y', $currentTime)
73+
date('n/j/y', $testTimestamp)
7474
]
7575
];
7676
}

0 commit comments

Comments
 (0)