@@ -50,38 +50,42 @@ public function testGetValue(array $data, string $expect): void
50
50
*/
51
51
public function getValueDataProvider (): array
52
52
{
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 ] = [
57
58
[
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 ' ),
61
65
],
62
- $ date ->format ('m/j/y g:i A ' ),
63
- ],
64
- [
65
66
[
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 ' ),
68
72
],
69
- $ date ->format ('g:i A ' ),
70
- ],
71
- [
72
73
[
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 ' ),
75
79
],
76
- $ date ->format ('m/j/y ' ),
77
- ],
78
- [
79
80
[
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 ' ),
82
86
],
83
- $ date -> format ( ' d-m-Y ' ),
84
- ],
85
- ] ;
87
+ ];
88
+ }
89
+ return array_merge ( $ data [ 0 ], $ data [ 1 ]) ;
86
90
}
87
91
}
0 commit comments