Fix flaky schedule automatic email test

[MAILPOET-3793]
This commit is contained in:
Brezo Cordero
2021-09-27 13:45:06 -05:00
committed by Veljko V
parent 06ddc42657
commit d37f0642d5
3 changed files with 20 additions and 6 deletions

View File

@@ -33,8 +33,8 @@ class Scheduler {
return $previousRunDate;
}
public static function getScheduledTimeWithDelay($afterTimeType, $afterTimeNumber) {
$wp = WPFunctions::get();
public static function getScheduledTimeWithDelay($afterTimeType, $afterTimeNumber, $wp = null): Carbon {
$wp = $wp ?? WPFunctions::get();
$currentTime = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
switch ($afterTimeType) {
case 'minutes':