Skip to content

Commit ba4053a

Browse files
MAGETWO-97866: [Magento Cloud] news_from_date and news_to_date dates incorrect in database with scheduled updates
Due to unstable work of intl parsing on different platforms
1 parent aa4b89c commit ba4053a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,21 @@ public function testTryScheduleWithConversionToAdminStoreTime(): void
272272
public function tryScheduleDataProvider(): array
273273
{
274274
$date = '2011-12-13 14:15:16';
275+
$timestamp = (new \DateTime($date, new \DateTimeZone('UTC')))->getTimestamp();
276+
$day = 'Monday';
275277
return [
276278
[$date, [], false],
277279
[$date, null, false],
278280
[$date, false, false],
279281
[$date, [], false],
280282
[$date, null, false],
281283
[$date, false, false],
282-
[strtotime($date), ['*', '*', '*', '*', '*'], true],
283-
[strtotime($date), ['15', '*', '*', '*', '*'], true],
284-
[strtotime($date), ['*', '14', '*', '*', '*'], true],
285-
[strtotime($date), ['*', '*', '13', '*', '*'], true],
286-
[strtotime($date), ['*', '*', '*', '12', '*'], true],
287-
[strtotime('Monday'), ['*', '*', '*', '*', '1'], true],
284+
[$timestamp, ['*', '*', '*', '*', '*'], true],
285+
[$timestamp, ['15', '*', '*', '*', '*'], true],
286+
[$timestamp, ['*', '14', '*', '*', '*'], true],
287+
[$timestamp, ['*', '*', '13', '*', '*'], true],
288+
[$timestamp, ['*', '*', '*', '12', '*'], true],
289+
[(new \DateTime($day, new \DateTimeZone('UTC')))->getTimestamp(), ['*', '*', '*', '*', '1'], true],
288290
];
289291
}
290292

0 commit comments

Comments
 (0)