Use a wrapped function for current_time [MAILPOET-2488]

This commit is contained in:
wxa
2019-12-25 14:13:52 +03:00
committed by amine-mp
parent 176aba69fe
commit 6ed3915b1a
20 changed files with 83 additions and 68 deletions

View File

@@ -495,8 +495,8 @@ class NewslettersTest extends \MailPoetTest {
$newsletter_option_field->name = 'schedule';
$newsletter_option_field->newsletter_type = Newsletter::TYPE_NOTIFICATION;
$newsletter_option_field->save();
$schedule = sprintf('0 %d * * *', Carbon::createFromTimestamp(current_time('timestamp'))->hour); // every day at current hour
$random_future_date = Carbon::createFromTimestamp(current_time('timestamp'))->addDays(10)->format('Y-m-d H:i:s'); // 10 days from now
$schedule = sprintf('0 %d * * *', Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->hour); // every day at current hour
$random_future_date = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->addDays(10)->format('Y-m-d H:i:s'); // 10 days from now
$newsletter_option = NewsletterOption::createOrUpdate(
[
'newsletter_id' => $this->post_notification->id,