@@ -206,14 +206,14 @@ public function testTrySchedule($scheduledAt, $cronExprArr, $expected): void
206
206
->willReturn ('UTC ' );
207
207
208
208
$ this ->dateTimeFactory ->method ('create ' )
209
- ->willReturn (new \DateTime (null , new \ DateTimeZone ( ' UTC ' ) ));
209
+ ->willReturn (new \DateTime ());
210
210
211
211
/** @var \Magento\Cron\Model\Schedule $model */
212
212
$ model = $ this ->helper ->getObject (
213
213
\Magento \Cron \Model \Schedule::class,
214
214
[
215
215
'timezoneConverter ' => $ this ->timezoneConverter ,
216
- 'dateTimeFactory ' => $ this ->dateTimeFactory
216
+ 'dateTimeFactory ' => $ this ->dateTimeFactory ,
217
217
]
218
218
);
219
219
@@ -242,14 +242,14 @@ public function testTryScheduleWithConversionToAdminStoreTime(): void
242
242
->willReturn ('UTC ' );
243
243
244
244
$ this ->dateTimeFactory ->method ('create ' )
245
- ->willReturn (new \DateTime (null , new \ DateTimeZone ( ' UTC ' ) ));
245
+ ->willReturn (new \DateTime ());
246
246
247
247
/** @var \Magento\Cron\Model\Schedule $model */
248
248
$ model = $ this ->helper ->getObject (
249
249
\Magento \Cron \Model \Schedule::class,
250
250
[
251
251
'timezoneConverter ' => $ this ->timezoneConverter ,
252
- 'dateTimeFactory ' => $ this ->dateTimeFactory
252
+ 'dateTimeFactory ' => $ this ->dateTimeFactory ,
253
253
]
254
254
);
255
255
@@ -272,7 +272,7 @@ public function testTryScheduleWithConversionToAdminStoreTime(): void
272
272
public function tryScheduleDataProvider (): array
273
273
{
274
274
$ date = '2011-12-13 14:15:16 ' ;
275
- $ timestamp = (new \DateTime ($ date, new \ DateTimeZone ( ' UTC ' ) ))->getTimestamp ();
275
+ $ timestamp = (new \DateTime ($ date ))->getTimestamp ();
276
276
$ day = 'Monday ' ;
277
277
return [
278
278
[$ date , [], false ],
@@ -286,7 +286,7 @@ public function tryScheduleDataProvider(): array
286
286
[$ timestamp , ['* ' , '14 ' , '* ' , '* ' , '* ' ], true ],
287
287
[$ timestamp , ['* ' , '* ' , '13 ' , '* ' , '* ' ], true ],
288
288
[$ timestamp , ['* ' , '* ' , '* ' , '12 ' , '* ' ], true ],
289
- [(new \DateTime ($ day, new \ DateTimeZone ( ' UTC ' ) ))->getTimestamp (), ['* ' , '* ' , '* ' , '* ' , '1 ' ], true ],
289
+ [(new \DateTime ($ day ))->getTimestamp (), ['* ' , '* ' , '* ' , '* ' , '1 ' ], true ],
290
290
];
291
291
}
292
292
0 commit comments