Take into account that the newsletter is scheduled at 5:45 and not 5:00

[MAILPOET-5528]
This commit is contained in:
David Remer
2023-08-14 09:07:09 +03:00
committed by Jan Lysý
parent 3566cc022d
commit 47a604d2c5

View File

@ -165,7 +165,7 @@ class PostNotificationTest extends \MailPoetTest {
$this->postNotificationScheduler->schedulePostNotification(10);
$currentTime = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'));
Carbon::setTestNow($currentTime); // mock carbon to return current time
$nextRunDate = ($currentTime->hour < 5) ?
$nextRunDate = ($currentTime->hour < 5) || ($currentTime->hour === 5 && $currentTime->minute < 45) ?
$currentTime :
$currentTime->addDay();
$queue = $this->sendingQueuesRepository->findOneBy(['newsletter' => $newsletter]);