Fix flakey test

[PREMIUM-136]
This commit is contained in:
Pavel Dohnal
2019-08-14 13:10:27 +02:00
committed by Jan Jakeš
parent 9b3be9bfee
commit dfb4545650

View File

@ -306,7 +306,7 @@ class Scheduler {
} }
static function getPreviousRunDate($schedule, $from_timestamp = false) { static function getPreviousRunDate($schedule, $from_timestamp = false) {
$wp = new WPFunctions(); $wp = WPFunctions::get();
$from_timestamp = ($from_timestamp) ? $from_timestamp : $wp->currentTime('timestamp'); $from_timestamp = ($from_timestamp) ? $from_timestamp : $wp->currentTime('timestamp');
try { try {
$schedule = \Cron\CronExpression::factory($schedule); $schedule = \Cron\CronExpression::factory($schedule);
@ -319,7 +319,7 @@ class Scheduler {
} }
static function getScheduledTimeWithDelay($after_time_type, $after_time_number) { static function getScheduledTimeWithDelay($after_time_type, $after_time_number) {
$wp = new WPFunctions(); $wp = WPFunctions::get();
$current_time = Carbon::createFromTimestamp($wp->currentTime('timestamp')); $current_time = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
switch ($after_time_type) { switch ($after_time_type) {
case 'minutes': case 'minutes':