Skip to content

Commit 397a04b

Browse files
committed
ACP2E-347 - update integration test
1 parent db28506 commit 397a04b

File tree

1 file changed

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

1 file changed

+29
-25
lines changed

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

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,42 @@ public function testGetValue(array $data, string $expect): void
5050
*/
5151
public function getValueDataProvider(): array
5252
{
53-
$testTimestamp = strtotime('2014-05-18 12:08:16');
54-
$date = new \DateTime('@' . $testTimestamp);
55-
return [
56-
[
53+
$testTimestamps = [strtotime('2020-05-18 12:08:16'), strtotime('1920-10-25 10:10:10')];
54+
$dates = [new \DateTime($testTimestamps[0]), new \DateTime($testTimestamps[1])];
55+
$data = [];
56+
foreach ($testTimestamps as $key => $testTimestamp) {
57+
$data[$key] = [
5758
[
58-
'date_format' => 'MM/d/yy',
59-
'time_format' => 'h:mm a',
60-
'value' => $testTimestamp,
59+
[
60+
'date_format' => 'MM/d/yy',
61+
'time_format' => 'h:mm a',
62+
'value' => $testTimestamp,
63+
],
64+
$dates[$key]->format('m/j/y g:i A'),
6165
],
62-
$date->format('m/j/y g:i A'),
63-
],
64-
[
6566
[
66-
'time_format' => 'h:mm a',
67-
'value' => $testTimestamp,
67+
[
68+
'time_format' => 'h:mm a',
69+
'value' => $testTimestamp,
70+
],
71+
$dates[$key]->format('g:i A'),
6872
],
69-
$date->format('g:i A'),
70-
],
71-
[
7273
[
73-
'date_format' => 'MM/d/yy',
74-
'value' => $testTimestamp,
74+
[
75+
'date_format' => 'MM/d/yy',
76+
'value' => $testTimestamp,
77+
],
78+
$dates[$key]->format('m/j/y'),
7579
],
76-
$date->format('m/j/y'),
77-
],
78-
[
7980
[
80-
'date_format' => 'd-MM-Y',
81-
'value' => $date->format('d-m-Y'),
81+
[
82+
'date_format' => 'd-MM-Y',
83+
'value' => $dates[$key]->format('d-m-Y'),
84+
],
85+
$dates[$key]->format('d-m-Y'),
8286
],
83-
$date->format('d-m-Y'),
84-
],
85-
];
87+
];
88+
}
89+
return array_merge($data[0], $data[1]);
8690
}
8791
}

0 commit comments

Comments
 (0)