@@ -243,13 +243,23 @@ public function testDateTime(string $alias): void
243
243
244
244
$ createdAt = $ results [0 ]['created_at ' ];
245
245
self ::assertInstanceOf (DateTime::class, $ createdAt );
246
- self ::assertEquals (1_559_414_432 , $ createdAt ->getSeconds ());
246
+ if ($ createdAt ->isLegacy ()) {
247
+ self ::assertEquals (1_559_414_432 , $ createdAt ->getSeconds ());
248
+ } else {
249
+ self ::assertEquals (1_559_418_032 , $ createdAt ->getSeconds ());
250
+ }
251
+
247
252
self ::assertEquals (142_000_000 , $ createdAt ->getNanoseconds ());
248
253
self ::assertEquals (3600 , $ createdAt ->getTimeZoneOffsetSeconds ());
249
254
self ::assertEquals (1_559_414_432 , $ createdAt ->getSeconds ());
250
255
self ::assertEquals (142_000_000 , $ createdAt ->getNanoseconds ());
251
256
self ::assertEquals (3600 , $ createdAt ->getTimeZoneOffsetSeconds ());
252
- self ::assertEquals ('{"seconds":1559414432,"nanoseconds":142000000,"tzOffsetSeconds":3600} ' , json_encode ($ createdAt , JSON_THROW_ON_ERROR ));
257
+
258
+ if ($ createdAt ->isLegacy ()) {
259
+ self ::assertEquals ('{"seconds":1559414432,"nanoseconds":142000000,"tzOffsetSeconds":3600} ' , json_encode ($ createdAt , JSON_THROW_ON_ERROR ));
260
+ } else {
261
+ self ::assertEquals ('{"seconds":1559418032,"nanoseconds":142000000,"tzOffsetSeconds":3600} ' , json_encode ($ createdAt , JSON_THROW_ON_ERROR ));
262
+ }
253
263
254
264
self ::assertInstanceOf (DateTime::class, $ results [1 ]['created_at ' ]);
255
265
self ::assertEquals (1_559_471_012 , $ results [1 ]['created_at ' ]->getSeconds ());
0 commit comments