Fix flakey test

[MAILPOET-2890]
This commit is contained in:
Pavel Dohnal
2020-06-08 12:48:18 +02:00
committed by Veljko V
parent 8485c63b45
commit 13b5a4b6a5
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,9 @@ class SendingServiceKeyCheck extends KeyCheckWorker {
return Bridge::isMPSendingServiceEnabled();
}
/**
* @return \DateTimeInterface|Carbon
*/
public function getNextRunDate() {
// when key pending approval, check key sate every hour
if ($this->servicesChecker->isMailPoetAPIKeyPendingApproval()) {

View File

@ -34,7 +34,8 @@ class SendingServiceKeyCheckTest extends \MailPoetTest {
public function testItRunsEveryHourWhenKeyPendingApproval() {
// normally next run is scheduled at a start of next day
expect($this->worker->getNextRunDate())->equals(Carbon::now()->startOfDay()->addDay());
expect($this->worker->getNextRunDate()->format('Y-m-d H:i:s'))
->equals(Carbon::now()->startOfDay()->addDay()->format('Y-m-d H:i:s'));
// when pending key approval, next run is scheduled in an hour
$settings = $this->diContainer->get(SettingsController::class);