diff --git a/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php b/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php index 7662aba125..a7a21aebd1 100644 --- a/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php @@ -253,7 +253,7 @@ class SettingsTest extends \MailPoetTest { ] ); $this->assertInstanceOf(ScheduledTaskEntity::class, $task); - expect($task->getScheduledAt())->lessThan(Carbon::now()); + verify($task->getScheduledAt())->lessThan(Carbon::now()); } public function testItRemovesFreeAddressOverrideOnMSSActivation() { diff --git a/mailpoet/tests/integration/Cron/ActionScheduler/Actions/DaemonRunTest.php b/mailpoet/tests/integration/Cron/ActionScheduler/Actions/DaemonRunTest.php index d93d622cef..155297d0ba 100644 --- a/mailpoet/tests/integration/Cron/ActionScheduler/Actions/DaemonRunTest.php +++ b/mailpoet/tests/integration/Cron/ActionScheduler/Actions/DaemonRunTest.php @@ -67,7 +67,7 @@ class DaemonRunTest extends \MailPoetTest { // Verify execution limit after run. floor(30 - some time taken by previous action) - 10s (safety execution timout margin) verify($this->daemonRun->getDaemonExecutionLimit())->greaterThan(0); - expect($this->daemonRun->getDaemonExecutionLimit())->lessThan(20); + verify($this->daemonRun->getDaemonExecutionLimit())->lessThan(20); } public function testItDoesNotContinueWhenThePreviousRunSuspiciouslyShort() { diff --git a/mailpoet/tests/integration/Cron/CronHelperTest.php b/mailpoet/tests/integration/Cron/CronHelperTest.php index 96330fba7b..933548ce9d 100644 --- a/mailpoet/tests/integration/Cron/CronHelperTest.php +++ b/mailpoet/tests/integration/Cron/CronHelperTest.php @@ -111,7 +111,7 @@ class CronHelperTest extends \MailPoetTest { $cronHelper->accessDaemon('some_token'); $updatedDaemon = $cronHelper->getDaemon(); verify($updatedDaemon['run_accessed_at'])->greaterThanOrEqual($time); - expect($updatedDaemon['run_accessed_at'])->lessThan($time + 2); + verify($updatedDaemon['run_accessed_at'])->lessThan($time + 2); } public function testItThrowsAnExceptionIfAccessingNonExistingDaemon() { diff --git a/mailpoet/tests/integration/Cron/DaemonHttpRunnerTest.php b/mailpoet/tests/integration/Cron/DaemonHttpRunnerTest.php index 6df60d818c..bbb57c3cd8 100644 --- a/mailpoet/tests/integration/Cron/DaemonHttpRunnerTest.php +++ b/mailpoet/tests/integration/Cron/DaemonHttpRunnerTest.php @@ -99,7 +99,7 @@ class DaemonHttpRunnerTest extends \MailPoetTest { $daemon = $this->makeEmpty(Daemon::class); $daemonHttpRunner = $this->make(DaemonHttpRunner::class, [ 'pauseExecution' => Expected::exactly(1, function($pauseDelay) { - expect($pauseDelay)->lessThan($this->cronHelper->getDaemonExecutionLimit()); + verify($pauseDelay)->lessThan($this->cronHelper->getDaemonExecutionLimit()); verify($pauseDelay)->greaterThan($this->cronHelper->getDaemonExecutionLimit() - 1); }), 'callSelf' => null, @@ -242,9 +242,9 @@ class DaemonHttpRunnerTest extends \MailPoetTest { $daemonHttpRunner->run($data); $updatedDaemon = $this->settings->get(CronHelper::DAEMON_SETTING); verify($updatedDaemon['run_started_at'])->greaterThanOrEqual($now); - expect($updatedDaemon['run_started_at'])->lessThan($now + 2); + verify($updatedDaemon['run_started_at'])->lessThan($now + 2); verify($updatedDaemon['run_completed_at'])->greaterThanOrEqual($now + 2); - expect($updatedDaemon['run_completed_at'])->lessThan($now + 4); + verify($updatedDaemon['run_completed_at'])->lessThan($now + 4); } public function testItCanRun() { diff --git a/mailpoet/tests/integration/Cron/Workers/KeyCheck/SendingServiceKeyCheckTest.php b/mailpoet/tests/integration/Cron/Workers/KeyCheck/SendingServiceKeyCheckTest.php index 7495370028..0b92a1c51b 100644 --- a/mailpoet/tests/integration/Cron/Workers/KeyCheck/SendingServiceKeyCheckTest.php +++ b/mailpoet/tests/integration/Cron/Workers/KeyCheck/SendingServiceKeyCheckTest.php @@ -38,7 +38,7 @@ class SendingServiceKeyCheckTest extends \MailPoetTest { $nextRun = $this->worker->getNextRunDate(); $nextDay = Carbon::now()->startOfDay()->addDay()->addHours(6); verify($nextRun->format('Y-m-d'))->equals($nextDay->format('Y-m-d')); - expect($nextRun)->lessThan($nextDay); + verify($nextRun)->lessThan($nextDay); // when pending key approval, next run is scheduled in an hour $settings = $this->diContainer->get(SettingsController::class); @@ -51,7 +51,7 @@ class SendingServiceKeyCheckTest extends \MailPoetTest { $nextRunDate = $this->worker->getNextRunDate(); verify($nextRunDate)->greaterThan(Carbon::now()->addMinutes(55)); - expect($nextRunDate)->lessThan(Carbon::now()->addMinutes(65)); + verify($nextRunDate)->lessThan(Carbon::now()->addMinutes(65)); } public function testItResumesSendingWhenKeyApproved() { diff --git a/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php b/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php index 527d3e5e8e..3ca4b9025c 100644 --- a/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php +++ b/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php @@ -714,7 +714,7 @@ class SchedulerTest extends \MailPoetTest { $scheduler->processScheduledStandardNewsletter($newsletter, $queue); $refetchedTask = $this->scheduledTasksRepository->findOneById($task->getId()); $this->assertInstanceOf(ScheduledTaskEntity::class, $refetchedTask); - expect($refetchedTask->getScheduledAt())->lessThan(Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->addHours(1)); + verify($refetchedTask->getScheduledAt())->lessThan(Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->addHours(1)); } /** diff --git a/mailpoet/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php b/mailpoet/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php index 655b37eb54..182fc0cbcc 100644 --- a/mailpoet/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php +++ b/mailpoet/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php @@ -1196,7 +1196,7 @@ class SendingQueueTest extends \MailPoetTest { $refetchedTask = ScheduledTask::where('id', $task->id)->findOne(); $this->assertInstanceOf(ScheduledTask::class, $refetchedTask); // PHPStan - expect($refetchedTask->scheduledAt)->lessThan(Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->addHours(42)); + verify($refetchedTask->scheduledAt)->lessThan(Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'))->addHours(42)); } public function testDoesNoRescheduleBounceTaskWhenPlannedInNearFuture() { diff --git a/mailpoet/tests/integration/Cron/Workers/SubscribersStatsReportTest.php b/mailpoet/tests/integration/Cron/Workers/SubscribersStatsReportTest.php index 317ce24aec..c5b39f4b76 100644 --- a/mailpoet/tests/integration/Cron/Workers/SubscribersStatsReportTest.php +++ b/mailpoet/tests/integration/Cron/Workers/SubscribersStatsReportTest.php @@ -106,11 +106,11 @@ class SubscribersStatsReportTest extends \MailPoetTest { $result = $this->worker->getNextRunDate(); verify($result)->instanceOf(Carbon::class); verify($result->getTimestamp())->greaterThan($time); - expect($result->getTimestamp())->lessThan($time + $maxExpectedScheduleInterval); + verify($result->getTimestamp())->lessThan($time + $maxExpectedScheduleInterval); $result2 = $this->worker->getNextRunDate(); verify($result2)->instanceOf(Carbon::class); verify($result2->getTimestamp())->greaterThan($time); - expect($result2->getTimestamp())->lessThan($time + $maxExpectedScheduleInterval); + verify($result2->getTimestamp())->lessThan($time + $maxExpectedScheduleInterval); verify($result2->getTimestamp())->notEquals($result->getTimestamp()); } } diff --git a/mailpoet/tests/integration/Models/SubscriberTest.php b/mailpoet/tests/integration/Models/SubscriberTest.php index 8273772f78..6f0be5a5ca 100644 --- a/mailpoet/tests/integration/Models/SubscriberTest.php +++ b/mailpoet/tests/integration/Models/SubscriberTest.php @@ -141,7 +141,7 @@ class SubscriberTest extends \MailPoetTest { $subscriberUpdated = Subscriber::where('email', $this->testData['email']) ->findOne(); $lastSubscribedAt = new Carbon($subscriberUpdated->lastUpdatedAt); - expect($lastSubscribedAt)->lessThan((new Carbon())->addSeconds(2)); + verify($lastSubscribedAt)->lessThan((new Carbon())->addSeconds(2)); verify($lastSubscribedAt)->greaterThan((new Carbon())->subSeconds(2)); // Change to other status keeps last_updated_at diff --git a/mailpoet/tests/integration/Statistics/Track/SubscriberActivityTrackerTest.php b/mailpoet/tests/integration/Statistics/Track/SubscriberActivityTrackerTest.php index e9a6e8e47f..e8dade8f05 100644 --- a/mailpoet/tests/integration/Statistics/Track/SubscriberActivityTrackerTest.php +++ b/mailpoet/tests/integration/Statistics/Track/SubscriberActivityTrackerTest.php @@ -105,9 +105,9 @@ class SubscriberActivityTrackerTest extends \MailPoetTest { $subscriber = $this->entityManager->getRepository(SubscriberEntity::class)->findOneBy(['wpUserId' => $user->ID]); $this->assertInstanceOf(SubscriberEntity::class, $subscriber); verify($subscriber->getLastEngagementAt())->greaterThan(Carbon::now()->subMinute()); - expect($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); + verify($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); verify($subscriber->getLastPageViewAt())->greaterThan(Carbon::now()->subMinute()); - expect($subscriber->getLastPageViewAt())->lessThan(Carbon::now()->addMinute()); + verify($subscriber->getLastPageViewAt())->lessThan(Carbon::now()->addMinute()); } /** @@ -146,7 +146,7 @@ class SubscriberActivityTrackerTest extends \MailPoetTest { verify($result)->true(); $this->entityManager->refresh($subscriber); verify($subscriber->getLastEngagementAt())->greaterThan(Carbon::now()->subMinute()); - expect($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); + verify($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); } public function testItUpdatesSubscriberEngagementForWpUserEvenWithDisabledCookieTracking() { @@ -165,7 +165,7 @@ class SubscriberActivityTrackerTest extends \MailPoetTest { verify($result)->true(); $this->entityManager->refresh($subscriber); verify($subscriber->getLastEngagementAt())->greaterThan(Carbon::now()->subMinute()); - expect($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); + verify($subscriber->getLastEngagementAt())->lessThan(Carbon::now()->addMinute()); } public function testItDoesntTrackWhenCookieTrackingIsDisabledAndThereInNoWPUser() {