Replace current_time usage in tests

[MAILPOET-6142]
This commit is contained in:
Rostislav Wolny
2024-08-05 13:29:23 +02:00
committed by Aschepikov
parent 33f4b2d729
commit 5fdba0e170
28 changed files with 80 additions and 105 deletions

View File

@@ -52,7 +52,7 @@ class KeyCheckWorkerTest extends \MailPoetTest {
$this
);
$currentTime = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'));
$currentTime = Carbon::now()->millisecond(0);
$task = $this->createRunningTask($currentTime);
$result = $worker->processTaskStrategy($task, microtime(true));
@@ -73,7 +73,7 @@ class KeyCheckWorkerTest extends \MailPoetTest {
$this
);
$currentTime = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'));
$currentTime = Carbon::now()->millisecond(0);
$task = $this->createRunningTask($currentTime);
$result = $worker->processTaskStrategy($task, microtime(true));
@@ -108,7 +108,7 @@ class KeyCheckWorkerTest extends \MailPoetTest {
private function createRunningTask(Carbon $scheduledAt = null) {
if (!$scheduledAt) {
$scheduledAt = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'));
$scheduledAt = Carbon::now()->millisecond(0);
}
return $this->scheduledTaskFactory->create(