diff --git a/mailpoet/tests/integration/API/JSON/v1/FeatureFlagsTest.php b/mailpoet/tests/integration/API/JSON/v1/FeatureFlagsTest.php index 9187fda34d..52dc034465 100644 --- a/mailpoet/tests/integration/API/JSON/v1/FeatureFlagsTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/FeatureFlagsTest.php @@ -103,7 +103,7 @@ class FeatureFlagsTest extends \MailPoetTest { ]); $endpoint = $this->createEndpointWithFeatureDefaults([]); - expect($endpoint->getAll()->data)->isEmpty(); + verify($endpoint->getAll()->data)->empty(); } public function testItDoesNotSaveUnknownFlag() { diff --git a/mailpoet/tests/integration/API/JSON/v1/FormsTest.php b/mailpoet/tests/integration/API/JSON/v1/FormsTest.php index d9a483e527..87a3ec86a9 100644 --- a/mailpoet/tests/integration/API/JSON/v1/FormsTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/FormsTest.php @@ -229,7 +229,7 @@ class FormsTest extends \MailPoetTest { $response = $this->endpoint->restore(['id' => 'Invalid ID']); verify($response->errors[0]['error'])->equals('not_found'); verify($response->status)->equals(APIResponse::STATUS_NOT_FOUND); - expect($response->meta)->isEmpty(); + verify($response->meta)->empty(); } public function testItCanTrashAForm() { @@ -246,12 +246,12 @@ class FormsTest extends \MailPoetTest { $response = $this->endpoint->trash(['id' => 'Invalid ID']); verify($response->errors[0]['error'])->equals('not_found'); verify($response->status)->equals(APIResponse::STATUS_NOT_FOUND); - expect($response->meta)->isEmpty(); + verify($response->meta)->empty(); } public function testItCanDeleteAForm() { $response = $this->endpoint->delete(['id' => $this->form3->getId()]); - expect($response->data)->isEmpty(); + verify($response->data)->empty(); verify($response->status)->equals(APIResponse::STATUS_OK); verify($response->meta['count'])->equals(1); } @@ -260,7 +260,7 @@ class FormsTest extends \MailPoetTest { $response = $this->endpoint->delete(['id' => 'Invalid ID']); verify($response->errors[0]['error'])->equals('not_found'); verify($response->status)->equals(APIResponse::STATUS_NOT_FOUND); - expect($response->meta)->isEmpty(); + verify($response->meta)->empty(); } public function testItCanDuplicateAForm() { diff --git a/mailpoet/tests/integration/API/JSON/v1/NewslettersTest.php b/mailpoet/tests/integration/API/JSON/v1/NewslettersTest.php index 1f886b4084..816e19af8d 100644 --- a/mailpoet/tests/integration/API/JSON/v1/NewslettersTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/NewslettersTest.php @@ -348,7 +348,7 @@ class NewslettersTest extends \MailPoetTest { public function testItCanDeleteANewsletter() { $response = $this->endpoint->delete(['id' => $this->newsletter->getId()]); - expect($response->data)->isEmpty(); + verify($response->data)->empty(); verify($response->status)->equals(APIResponse::STATUS_OK); verify($response->meta['count'])->equals(1); } diff --git a/mailpoet/tests/integration/API/JSON/v1/SegmentsTest.php b/mailpoet/tests/integration/API/JSON/v1/SegmentsTest.php index 0908c177f1..abd31ed3f3 100644 --- a/mailpoet/tests/integration/API/JSON/v1/SegmentsTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/SegmentsTest.php @@ -203,7 +203,7 @@ class SegmentsTest extends \MailPoetTest { public function testItCanDeleteASegment() { $response = $this->endpoint->delete(['id' => $this->segment3->getId()]); - expect($response->data)->isEmpty(); + verify($response->data)->empty(); verify($response->status)->equals(APIResponse::STATUS_OK); verify($response->meta['count'])->equals(1); } diff --git a/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php b/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php index 8e309bec20..3c185daa60 100644 --- a/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/SettingsTest.php @@ -269,7 +269,7 @@ class SettingsTest extends \MailPoetTest { $this->settings->resetCache(); verify($this->settings->get('sender')['address'])->equals('johndoeexampletestnonexistinghopefullyfreemail@gmail.com'); - expect($this->settings->get('reply_to'))->isEmpty(); + verify($this->settings->get('reply_to'))->empty(); } public function testItDeactivatesReEngagementEmailsIfTrackingDisabled(): void { diff --git a/mailpoet/tests/integration/API/JSON/v1/SubscribersTest.php b/mailpoet/tests/integration/API/JSON/v1/SubscribersTest.php index ab5f95f57d..2d0dd412ac 100644 --- a/mailpoet/tests/integration/API/JSON/v1/SubscribersTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/SubscribersTest.php @@ -350,7 +350,7 @@ class SubscribersTest extends \MailPoetTest { public function testItCanDeleteASubscriber() { $response = $this->endpoint->delete(['id' => $this->subscriber1->getId()]); - expect($response->data)->isEmpty(); + verify($response->data)->empty(); verify($response->status)->equals(APIResponse::STATUS_OK); verify($response->meta['count'])->equals(1); } @@ -604,7 +604,7 @@ class SubscribersTest extends \MailPoetTest { 'action' => 'delete', ]); verify($response->status)->equals(APIResponse::STATUS_OK); - expect($response->data)->isEmpty(); + verify($response->data)->empty(); verify($response->meta['count'])->equals(count($selectionIds)); $this->entityManager->clear(); @@ -938,7 +938,7 @@ class SubscribersTest extends \MailPoetTest { // welcome notification is created only for segment #1 $this->endpoint->save($subscriberData); - expect($this->sendingQueuesRepository->findAll())->isEmpty(); + verify($this->sendingQueuesRepository->findAll())->empty(); $subscriberData['segments'] = [$this->segment1->getId()]; $this->endpoint->save($subscriberData); diff --git a/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/FirstPurchaseTest.php b/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/FirstPurchaseTest.php index 03c0661dc0..6779c45f8d 100644 --- a/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/FirstPurchaseTest.php +++ b/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/FirstPurchaseTest.php @@ -157,7 +157,7 @@ class FirstPurchaseTest extends \MailPoetTest { ]); $event = new FirstPurchase($helper); $result = $event->scheduleEmailWhenOrderIsPlaced(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenCustomerEmailIsEmpty() { @@ -173,7 +173,7 @@ class FirstPurchaseTest extends \MailPoetTest { ]); $event = new FirstPurchase($helper); $result = $event->scheduleEmailWhenOrderIsPlaced(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenItIsNotCustomersFirstPurchase() { @@ -185,7 +185,7 @@ class FirstPurchaseTest extends \MailPoetTest { 'getCustomerOrderCount' => 2, ]); $result = $event->scheduleEmailWhenOrderIsPlaced(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenCustomerIsNotAWCSegmentSubscriber() { @@ -216,7 +216,7 @@ class FirstPurchaseTest extends \MailPoetTest { $event = new FirstPurchase($helper); $result = $event->scheduleEmailWhenOrderIsPlaced(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItScheduleEmailForGuestCustomer() { @@ -240,7 +240,7 @@ class FirstPurchaseTest extends \MailPoetTest { $event = new FirstPurchase($this->wooCommerceHelper); $result = $event->scheduleEmailWhenOrderIsPlaced($order->get_id()); - expect($result)->isEmpty(); + verify($result)->empty(); $sendingQueue = $this->sendingQueueRepository->findOneBy(['newsletter' => $newsletter]); $this->assertInstanceOf(SendingQueueEntity::class, $sendingQueue); diff --git a/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/PurchasedProductTest.php b/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/PurchasedProductTest.php index 6ee41b6991..db5fd9181f 100644 --- a/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/PurchasedProductTest.php +++ b/mailpoet/tests/integration/AutomaticEmails/WooCommerce/Events/PurchasedProductTest.php @@ -53,7 +53,7 @@ class PurchasedProductTest extends \MailPoetTest { ]); $event = new PurchasedProduct($helper); $result = $event->scheduleEmailWhenProductIsPurchased(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenCustomerEmailIsEmpty() { @@ -70,7 +70,7 @@ class PurchasedProductTest extends \MailPoetTest { $event = new PurchasedProduct($helper); $result = $event->scheduleEmailWhenProductIsPurchased(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenCustomerIsNotAWCSegmentSubscriber() { @@ -97,7 +97,7 @@ class PurchasedProductTest extends \MailPoetTest { $event = new PurchasedProduct($helper); $result = $event->scheduleEmailWhenProductIsPurchased(12); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesNotScheduleEmailWhenAlreadySent() { @@ -139,7 +139,7 @@ class PurchasedProductTest extends \MailPoetTest { $email = $this->createEmailTriggeredByProductIds([2000, 3000]); $event = $this->createOrderEvent($subscriber, [1000]); $scheduledTask = $this->triggerEmailForState('completed', $email, $event); - expect($scheduledTask)->isEmpty(); + verify($scheduledTask)->empty(); } public function testItSchedulesEmailForProcessingOrder() { diff --git a/mailpoet/tests/integration/Config/TranslationUpdaterTest.php b/mailpoet/tests/integration/Config/TranslationUpdaterTest.php index 81f60e6bfb..2ec9bec02c 100644 --- a/mailpoet/tests/integration/Config/TranslationUpdaterTest.php +++ b/mailpoet/tests/integration/Config/TranslationUpdaterTest.php @@ -169,7 +169,7 @@ class TranslationUpdaterTest extends \MailPoetTest { ] ); $result = $updater->checkForTranslations($updateTransient); - expect($result->translations)->isEmpty(); + verify($result->translations)->empty(); } public function testItDoesNotOverrideNewerVersionInCaseItWasInstalledFromDotOrg(): void { diff --git a/mailpoet/tests/integration/Cron/CronWorkerRunnerTest.php b/mailpoet/tests/integration/Cron/CronWorkerRunnerTest.php index 7430c8dce0..c7b6ee6548 100644 --- a/mailpoet/tests/integration/Cron/CronWorkerRunnerTest.php +++ b/mailpoet/tests/integration/Cron/CronWorkerRunnerTest.php @@ -143,7 +143,7 @@ class CronWorkerRunnerTest extends \MailPoetTest { $this->assertInstanceOf(ScheduledTaskEntity::class, $task); expect($task->getScheduledAt())->greaterThan($scheduledAt); verify($task->getStatus())->same(ScheduledTaskEntity::STATUS_SCHEDULED); - expect($task->getInProgress())->isEmpty(); + verify($task->getInProgress())->empty(); // reset the state of the updatedAt field. this is needed to reset the state of TimestampListener::now otherwise it will impact other tests. // this code can be removed once https://mailpoet.atlassian.net/browse/MAILPOET-3870 is fixed. @@ -171,7 +171,7 @@ class CronWorkerRunnerTest extends \MailPoetTest { expect($task->getScheduledAt())->greaterThan($scheduledAt); verify($task->getStatus())->same(ScheduledTaskEntity::STATUS_SCHEDULED); verify($task->getRescheduleCount())->equals(1); - expect($task->getInProgress())->isEmpty(); + verify($task->getInProgress())->empty(); } } diff --git a/mailpoet/tests/integration/Cron/Triggers/WordPressTest.php b/mailpoet/tests/integration/Cron/Triggers/WordPressTest.php index dcc7bd6a71..b361abd01f 100644 --- a/mailpoet/tests/integration/Cron/Triggers/WordPressTest.php +++ b/mailpoet/tests/integration/Cron/Triggers/WordPressTest.php @@ -89,7 +89,7 @@ class WordPressTest extends \MailPoetTest { $this->settings->set(WordPress::LAST_RUN_AT_SETTING, $currentTime); $this->addQueue(SendingQueueEntity::STATUS_SCHEDULED); WordPress::resetRunInterval(); - expect($this->settings->get(WordPress::LAST_RUN_AT_SETTING))->isEmpty(); + verify($this->settings->get(WordPress::LAST_RUN_AT_SETTING))->empty(); verify($this->wordpressTrigger->run())->notEmpty(); } diff --git a/mailpoet/tests/integration/Cron/Workers/BounceTest.php b/mailpoet/tests/integration/Cron/Workers/BounceTest.php index 22125326de..12b9619797 100644 --- a/mailpoet/tests/integration/Cron/Workers/BounceTest.php +++ b/mailpoet/tests/integration/Cron/Workers/BounceTest.php @@ -107,7 +107,7 @@ class BounceTest extends \MailPoetTest { $this->truncateEntity(SubscriberEntity::class); $task = $this->createScheduledTask(); $this->worker->prepareTaskStrategy($task, microtime(true)); - expect($this->scheduledTaskSubscribersRepository->findBy(['task' => $task]))->isEmpty(); + verify($this->scheduledTaskSubscribersRepository->findBy(['task' => $task]))->empty(); } public function testItPreparesTask() { @@ -134,7 +134,7 @@ class BounceTest extends \MailPoetTest { // process - no subscribers found, ScheduledTaskSubscriber will be cleaned up $task = $this->createScheduledTask(); $this->worker->processTaskStrategy($task, microtime(true)); - expect($this->scheduledTaskSubscribersRepository->findBy(['task' => $task]))->isEmpty(); + verify($this->scheduledTaskSubscribersRepository->findBy(['task' => $task]))->empty(); } public function testItProcessesTask() { diff --git a/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php b/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php index 3eb14ea67d..4799ee4be2 100644 --- a/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php +++ b/mailpoet/tests/integration/Cron/Workers/SchedulerTest.php @@ -125,7 +125,7 @@ class SchedulerTest extends \MailPoetTest { public function testItCanGetScheduledQueues() { $scheduler = $this->diContainer->get(Scheduler::class); - expect($scheduler->getScheduledSendingTasks())->isEmpty(); + verify($scheduler->getScheduledSendingTasks())->empty(); $queue = SendingTask::create(); $queue->newsletterId = 1; $queue->status = SendingQueueEntity::STATUS_SCHEDULED; @@ -148,7 +148,7 @@ class SchedulerTest extends \MailPoetTest { // ensure that notification history does not exist $notificationHistory = $this->newslettersRepository->findOneBy(['parent' => $newsletter, 'type' => NewsletterEntity::TYPE_NOTIFICATION_HISTORY]); - expect($notificationHistory)->isEmpty(); + verify($notificationHistory)->empty(); // create notification history and ensure that it exists $scheduler = $this->getScheduler(); diff --git a/mailpoet/tests/integration/Cron/Workers/SimpleWorkerTest.php b/mailpoet/tests/integration/Cron/Workers/SimpleWorkerTest.php index 2b932b42c9..c2b591fe95 100644 --- a/mailpoet/tests/integration/Cron/Workers/SimpleWorkerTest.php +++ b/mailpoet/tests/integration/Cron/Workers/SimpleWorkerTest.php @@ -42,7 +42,7 @@ class SimpleWorkerTest extends \MailPoetTest { } public function testItSchedulesTask() { - expect($this->scheduledTasksRepository->findBy(['type' => MockSimpleWorker::TASK_TYPE]))->isEmpty(); + verify($this->scheduledTasksRepository->findBy(['type' => MockSimpleWorker::TASK_TYPE]))->empty(); (new MockSimpleWorker())->schedule(); verify($this->scheduledTasksRepository->findBy(['type' => MockSimpleWorker::TASK_TYPE]))->notEmpty(); } diff --git a/mailpoet/tests/integration/Cron/Workers/WooCommerceOrdersTest.php b/mailpoet/tests/integration/Cron/Workers/WooCommerceOrdersTest.php index 4a6602f050..e84c1605ed 100644 --- a/mailpoet/tests/integration/Cron/Workers/WooCommerceOrdersTest.php +++ b/mailpoet/tests/integration/Cron/Workers/WooCommerceOrdersTest.php @@ -59,7 +59,7 @@ class WooCommerceOrdersTest extends \MailPoetTest { $this->cronWorkerRunner->run($this->worker); $tasks = $this->scheduledTaskRepository->findBy(['type' => WooCommercePastOrders::TASK_TYPE]); - expect($tasks)->isEmpty(); + verify($tasks)->empty(); } public function testItRunsIfWooCommerceIsEnabled() { diff --git a/mailpoet/tests/integration/Logging/LogHandlerTest.php b/mailpoet/tests/integration/Logging/LogHandlerTest.php index 30dbba3e9a..b66105f137 100644 --- a/mailpoet/tests/integration/Logging/LogHandlerTest.php +++ b/mailpoet/tests/integration/Logging/LogHandlerTest.php @@ -75,7 +75,7 @@ class LogHandlerTest extends \MailPoetTest { ]); $log = $this->repository->findBy(['name' => 'old name']); - expect($log)->isEmpty(); + verify($log)->empty(); } public function testItNotPurgesOldLogs() { diff --git a/mailpoet/tests/integration/Mailer/Methods/SMTPTest.php b/mailpoet/tests/integration/Mailer/Methods/SMTPTest.php index bda9080f70..ca56b93991 100644 --- a/mailpoet/tests/integration/Mailer/Methods/SMTPTest.php +++ b/mailpoet/tests/integration/Mailer/Methods/SMTPTest.php @@ -141,7 +141,7 @@ class SMTPTest extends \MailPoetTest { public function testItAppliesSMTPOptionsFilter() { $mailer = $this->mailer->buildMailer(); - expect($mailer->SMTPOptions)->isEmpty(); + verify($mailer->SMTPOptions)->empty(); (new WPFunctions)->addFilter( 'mailpoet_mailer_smtp_options', function() { diff --git a/mailpoet/tests/integration/Models/NewsletterTest.php b/mailpoet/tests/integration/Models/NewsletterTest.php index 3cd2daa7ca..b9f2b25d85 100644 --- a/mailpoet/tests/integration/Models/NewsletterTest.php +++ b/mailpoet/tests/integration/Models/NewsletterTest.php @@ -237,10 +237,10 @@ class NewsletterTest extends \MailPoetTest { } Newsletter::filter('bulkTrash'); - expect(Newsletter::whereNull('deleted_at')->findArray())->isEmpty(); + verify(Newsletter::whereNull('deleted_at')->findArray())->empty(); Newsletter::filter('bulkRestore'); - expect(Newsletter::whereNotNull('deleted_at')->findArray())->isEmpty(); + verify(Newsletter::whereNotNull('deleted_at')->findArray())->empty(); } public function testItDeletesSegmentAndQueueAssociationsWhenNewsletterIsDeleted() { @@ -260,9 +260,9 @@ class NewsletterTest extends \MailPoetTest { // delete newsletter and check that relations no longer exist $newsletter->delete(); - expect(SendingQueue::where('newsletter_id', $newsletter->id)->findArray())->isEmpty(); + verify(SendingQueue::where('newsletter_id', $newsletter->id)->findArray())->empty(); $newsletterSegments = NewsletterSegment::where('newsletter_id', $newsletter->id)->findArray(); - expect($newsletterSegments)->isEmpty(); + verify($newsletterSegments)->empty(); } public function testItDeletesChildrenSegmentAndQueueAssociationsWhenParentNewsletterIsDeleted() { @@ -415,7 +415,7 @@ class NewsletterTest extends \MailPoetTest { $this->newsletterOptionFactory->create($newsletterEntity, 'meta', json_encode($meta)); // by default meta option does not exist on newsletter object - expect($newsletter->getMeta())->isEmpty(); + verify($newsletter->getMeta())->empty(); // if meta option exists, it should be returned as an array $newsletter = Newsletter::filter('filterWithOptions', Newsletter::TYPE_AUTOMATIC)->findOne($newsletter->id); diff --git a/mailpoet/tests/integration/Models/SubscriberCustomFieldTest.php b/mailpoet/tests/integration/Models/SubscriberCustomFieldTest.php index c53ab3c1f4..7b01e49332 100644 --- a/mailpoet/tests/integration/Models/SubscriberCustomFieldTest.php +++ b/mailpoet/tests/integration/Models/SubscriberCustomFieldTest.php @@ -64,7 +64,7 @@ class SubscriberCustomFieldTest extends \MailPoetTest { ] ); $records = SubscriberCustomField::findArray(); - expect($records)->isEmpty(); + verify($records)->empty(); } public function testItCanDeleteSubscriberRelations() { diff --git a/mailpoet/tests/integration/Models/SubscriberSegmentTest.php b/mailpoet/tests/integration/Models/SubscriberSegmentTest.php index 7aa6a97a0a..40818442db 100644 --- a/mailpoet/tests/integration/Models/SubscriberSegmentTest.php +++ b/mailpoet/tests/integration/Models/SubscriberSegmentTest.php @@ -155,7 +155,7 @@ class SubscriberSegmentTest extends \MailPoetTest { verify($result)->true(); $subscribedSegments = $this->subscriber->segments()->findArray(); - expect($subscribedSegments)->isEmpty(); + verify($subscribedSegments)->empty(); // the relations still exist but now have a status of "unsubscribed" $subscriptionsCount = SubscriberSegment::where( diff --git a/mailpoet/tests/integration/Models/SubscriberTest.php b/mailpoet/tests/integration/Models/SubscriberTest.php index 45235128b7..f472a0a3f3 100644 --- a/mailpoet/tests/integration/Models/SubscriberTest.php +++ b/mailpoet/tests/integration/Models/SubscriberTest.php @@ -440,7 +440,7 @@ class SubscriberTest extends \MailPoetTest { $record->lastName = 'Mailer'; $result = Subscriber::createOrUpdate($record->asArray()); verify($result)->notEquals(false); - expect($result->getValidationErrors())->isEmpty(); + verify($result->getValidationErrors())->empty(); $record = Subscriber::where('email', $data['email']) ->findOne(); verify($record->lastName)->equals('Mailer'); @@ -855,8 +855,8 @@ class SubscriberTest extends \MailPoetTest { ] ); verify($result->getErrors())->false(); - expect($result->firstName)->isEmpty(); - expect($result->lastName)->isEmpty(); + verify($result->firstName)->empty(); + verify($result->lastName)->empty(); verify($result->status)->equals(Subscriber::STATUS_UNCONFIRMED); } diff --git a/mailpoet/tests/integration/Newsletter/Scheduler/SchedulerTest.php b/mailpoet/tests/integration/Newsletter/Scheduler/SchedulerTest.php index eed167c4f4..0b60bb626d 100644 --- a/mailpoet/tests/integration/Newsletter/Scheduler/SchedulerTest.php +++ b/mailpoet/tests/integration/Newsletter/Scheduler/SchedulerTest.php @@ -26,7 +26,7 @@ class SchedulerTest extends \MailPoetTest { $newsletterFactory->withWelcomeTypeForSegment()->withActiveStatus()->create(); // no newsletters with type "notification" should be found - expect($this->testee->getNewsletters(NewsletterEntity::TYPE_NOTIFICATION))->isEmpty(); + verify($this->testee->getNewsletters(NewsletterEntity::TYPE_NOTIFICATION))->empty(); // one newsletter with type "welcome" should be found expect($this->testee->getNewsletters(NewsletterEntity::TYPE_WELCOME))->count(1); @@ -35,7 +35,7 @@ class SchedulerTest extends \MailPoetTest { $newsletter = $newsletterFactory->withAutomaticType()->withActiveStatus()->create(); $newsletterOptionFactory->create($newsletter, 'group', 'test'); - expect($this->testee->getNewsletters(NewsletterEntity::TYPE_WELCOME, 'group_does_not_exist'))->isEmpty(); + verify($this->testee->getNewsletters(NewsletterEntity::TYPE_WELCOME, 'group_does_not_exist'))->empty(); expect($this->testee->getNewsletters(NewsletterEntity::TYPE_AUTOMATIC, 'test'))->count(1); } diff --git a/mailpoet/tests/integration/Newsletter/ShortcodesTest.php b/mailpoet/tests/integration/Newsletter/ShortcodesTest.php index 591bf08e58..e8f72358c2 100644 --- a/mailpoet/tests/integration/Newsletter/ShortcodesTest.php +++ b/mailpoet/tests/integration/Newsletter/ShortcodesTest.php @@ -93,10 +93,10 @@ class ShortcodesTest extends \MailPoetTest { verify($details['argument_value'])->equals('default_value'); $content = '[category:action|default]'; $details = $shortcodesObject->match($content); - expect($details)->isEmpty(); + verify($details)->empty(); $content = '[category|default:default_value]'; $details = $shortcodesObject->match($content); - expect($details)->isEmpty(); + verify($details)->empty(); } public function testItCanProcessCustomShortcodes() { diff --git a/mailpoet/tests/integration/Segments/DynamicSegments/Filters/SubscriberSubscribedViaFormTest.php b/mailpoet/tests/integration/Segments/DynamicSegments/Filters/SubscriberSubscribedViaFormTest.php index c632a1520a..e157c8ea1d 100644 --- a/mailpoet/tests/integration/Segments/DynamicSegments/Filters/SubscriberSubscribedViaFormTest.php +++ b/mailpoet/tests/integration/Segments/DynamicSegments/Filters/SubscriberSubscribedViaFormTest.php @@ -35,7 +35,7 @@ class SubscriberSubscribedViaFormTest extends \MailPoetTest { $subscriber = (new Subscriber())->withEmail('subscriber1@example.com')->create(); (new StatisticsForms($form, $subscriber))->create(); $matching = $this->getMatchingEmails('any', [$form->getId() + 1]); - expect($matching)->isEmpty(); + verify($matching)->empty(); } public function testItWorksWithMultipleForms(): void { diff --git a/mailpoet/tests/integration/Segments/WPTest.php b/mailpoet/tests/integration/Segments/WPTest.php index fda8f20ba1..772cb23dbd 100644 --- a/mailpoet/tests/integration/Segments/WPTest.php +++ b/mailpoet/tests/integration/Segments/WPTest.php @@ -222,7 +222,7 @@ class WPTest extends \MailPoetTest { $this->updateWPUserEmail($id, ''); $this->wpSegment->synchronizeUsers(); $subscriber = Subscriber::where('wp_user_id', $id)->findOne(); - expect($subscriber)->isEmpty(); + verify($subscriber)->empty(); $this->deleteWPUser($id); } @@ -412,7 +412,7 @@ class WPTest extends \MailPoetTest { verify($dbSubscriber)->notEmpty(); $this->wpSegment->synchronizeUsers(); $dbSubscriber = Subscriber::findOne($subscriber->id); - expect($dbSubscriber)->isEmpty(); + verify($dbSubscriber)->empty(); } public function testItAddsNewUserToDisabledWpSegmentAsUnconfirmedAndTrashed(): void { diff --git a/mailpoet/tests/integration/Segments/WooCommerceTest.php b/mailpoet/tests/integration/Segments/WooCommerceTest.php index 13e1aa41fd..b93dc59a7d 100644 --- a/mailpoet/tests/integration/Segments/WooCommerceTest.php +++ b/mailpoet/tests/integration/Segments/WooCommerceTest.php @@ -126,7 +126,7 @@ class WooCommerceTest extends \MailPoetTest { $guest = $this->insertGuestCustomer(); $this->wooCommerceSegment->synchronizeGuestCustomer($guest['order_id']); $subscribers = $this->getWCSubscribersByEmails([$guest['email']]); - expect($subscribers)->isEmpty(); + verify($subscribers)->empty(); $subscriber = $this->subscribersRepository->findOneBy(['email' => $guest['email']]); $this->assertInstanceOf(SubscriberEntity::class, $subscriber); verify($subscriber->getFirstName())->equals($guest['first_name']); @@ -142,7 +142,7 @@ class WooCommerceTest extends \MailPoetTest { $guest = $this->insertGuestCustomer(); $this->wooCommerceSegment->synchronizeGuestCustomer($guest['order_id']); $subscribers = $this->getWCSubscribersByEmails([$guest['email']]); - expect($subscribers)->isEmpty(); + verify($subscribers)->empty(); $subscriber = $this->subscribersRepository->findOneBy(['email' => $guest['email']]); $this->assertInstanceOf(SubscriberEntity::class, $subscriber); verify($subscriber->getFirstName())->equals($guest['first_name']); @@ -158,7 +158,7 @@ class WooCommerceTest extends \MailPoetTest { $guest = $this->insertGuestCustomer(); $this->wooCommerceSegment->synchronizeGuestCustomer($guest['order_id']); $subscribers = $this->getWCSubscribersByEmails([$guest['email']]); - expect($subscribers)->isEmpty(); + verify($subscribers)->empty(); $subscriber = $this->subscribersRepository->findOneBy(['email' => $guest['email']]); $this->assertInstanceOf(SubscriberEntity::class, $subscriber); verify($subscriber->getFirstName())->equals($guest['first_name']); @@ -271,7 +271,7 @@ class WooCommerceTest extends \MailPoetTest { update_post_meta($guest['order_id'], '_billing_email', ''); $this->synchronizeAllCustomers(); $subscriber = $this->subscribersRepository->findOneBy(['email' => '']); - expect($subscriber)->isEmpty(); + verify($subscriber)->empty(); $this->tester->deleteTestWooOrders(); } @@ -281,7 +281,7 @@ class WooCommerceTest extends \MailPoetTest { update_post_meta($guest['order_id'], '_billing_email', $invalidEmail); $this->synchronizeAllCustomers(); $subscriber = $this->subscribersRepository->findOneBy(['email' => $invalidEmail]); - expect($subscriber)->isEmpty(); + verify($subscriber)->empty(); $this->tester->deleteTestWooOrders(); } @@ -442,7 +442,7 @@ class WooCommerceTest extends \MailPoetTest { verify($this->subscriberSegmentsRepository->findOneById($association->getId()))->notEmpty(); $this->synchronizeAllCustomers(); $this->entityManager->clear(); - expect($this->subscriberSegmentsRepository->findOneById($association->getId()))->isEmpty(); + verify($this->subscriberSegmentsRepository->findOneById($association->getId()))->empty(); } public function testItUnsubscribesSubscribersWithoutEmailFromWCSegment(): void { @@ -460,7 +460,7 @@ class WooCommerceTest extends \MailPoetTest { verify($this->subscriberSegmentsRepository->findOneById($association->getId()))->notEmpty(); $this->entityManager->clear(); $this->synchronizeAllCustomers(); - expect($this->subscriberSegmentsRepository->findOneById($association->getId()))->isEmpty(); + verify($this->subscriberSegmentsRepository->findOneById($association->getId()))->empty(); } public function testItSetGlobalStatusUnsubscribedForUsersUnsyncedFromWooCommerceSegment(): void { diff --git a/mailpoet/tests/integration/Statistics/Track/ClicksTest.php b/mailpoet/tests/integration/Statistics/Track/ClicksTest.php index 6b97847c8c..25e3ab31d8 100644 --- a/mailpoet/tests/integration/Statistics/Track/ClicksTest.php +++ b/mailpoet/tests/integration/Statistics/Track/ClicksTest.php @@ -151,8 +151,8 @@ class ClicksTest extends \MailPoetTest { ], $this); $clicks->track($data); - expect($this->statisticsClicksRepository->findAll())->isEmpty(); - expect($this->statisticsOpensRepository->findAll())->isEmpty(); + verify($this->statisticsClicksRepository->findAll())->empty(); + verify($this->statisticsOpensRepository->findAll())->empty(); } public function testItTracksClickAndOpenEvent() { diff --git a/mailpoet/tests/integration/Statistics/Track/OpensTest.php b/mailpoet/tests/integration/Statistics/Track/OpensTest.php index df2d84f1a0..8f61ca0ced 100644 --- a/mailpoet/tests/integration/Statistics/Track/OpensTest.php +++ b/mailpoet/tests/integration/Statistics/Track/OpensTest.php @@ -97,7 +97,7 @@ class OpensTest extends \MailPoetTest { 'returnResponse' => Expected::exactly(1), ], $this); $opens->track(false); - expect($this->statisticsOpensRepository->findAll())->isEmpty(); + verify($this->statisticsOpensRepository->findAll())->empty(); } public function testItDoesNotTrackOpenEventFromWpUserWhenPreviewIsEnabled() { @@ -112,11 +112,11 @@ class OpensTest extends \MailPoetTest { 'returnResponse' => null, ], $this); $opens->track($data); - expect($this->statisticsOpensRepository->findAll())->isEmpty(); + verify($this->statisticsOpensRepository->findAll())->empty(); } public function testItReturnsNothingWhenImageDisplayIsDisabled() { - expect($this->opens->track($this->trackData, $displayImage = false))->isEmpty(); + verify($this->opens->track($this->trackData, $displayImage = false))->empty(); } public function testItTracksOpenEvent() { diff --git a/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php b/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php index 3343e2e58e..086abd2ef3 100644 --- a/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php +++ b/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php @@ -252,7 +252,7 @@ class ImportTest extends \MailPoetTest { $result = $this->import->validateSubscribersData($data); $this->assertIsArray($result); expect($result['confirmed_ip'])->count(2); - expect($result['confirmed_ip'][0])->isEmpty(); + verify($result['confirmed_ip'][0])->empty(); verify($result['confirmed_ip'][1])->equals('192.68.69.32'); // invalid IPv4 confirmed_ip is empty in the data object @@ -263,7 +263,7 @@ class ImportTest extends \MailPoetTest { $result = $this->import->validateSubscribersData($data); $this->assertIsArray($result); expect($result['confirmed_ip'])->count(2); - expect($result['confirmed_ip'][0])->isEmpty(); + verify($result['confirmed_ip'][0])->empty(); verify($result['confirmed_ip'][1])->equals('192.68.69.32'); // Empty confirmed_ip is empty in the data object @@ -274,7 +274,7 @@ class ImportTest extends \MailPoetTest { $result = $this->import->validateSubscribersData($data); $this->assertIsArray($result); expect($result['confirmed_ip'])->count(2); - expect($result['confirmed_ip'][0])->isEmpty(); + verify($result['confirmed_ip'][0])->empty(); verify($result['confirmed_ip'][1])->equals('192.68.69.32'); // normalize confirmed_at diff --git a/mailpoet/tests/integration/Subscribers/SubscriberActionsTest.php b/mailpoet/tests/integration/Subscribers/SubscriberActionsTest.php index 63b527f4df..b717f7f7b2 100644 --- a/mailpoet/tests/integration/Subscribers/SubscriberActionsTest.php +++ b/mailpoet/tests/integration/Subscribers/SubscriberActionsTest.php @@ -232,7 +232,7 @@ class SubscriberActionsTest extends \MailPoetTest { $this->assertInstanceOf(SubscriberCustomFieldEntity::class, $subscriberCustomField); verify($subscriberCustomField->getValue())->equals($data['cf_' . $customField->getId()]); - expect($subscriber->getUnconfirmedData())->isEmpty(); + verify($subscriber->getUnconfirmedData())->empty(); $data2 = $data; $data2['first_name'] = 'Aaa'; @@ -261,7 +261,7 @@ class SubscriberActionsTest extends \MailPoetTest { // during confirmation, manual admin editing $saveController = ContainerWrapper::getInstance()->get(SubscriberSaveController::class); $subscriber = $saveController->createOrUpdate($data2, $subscriber); - expect($subscriber->getUnconfirmedData())->isEmpty(); + verify($subscriber->getUnconfirmedData())->empty(); $this->settings->set('signup_confirmation.enabled', $originalSettingValue); } diff --git a/mailpoet/tests/integration/Subscription/FormTest.php b/mailpoet/tests/integration/Subscription/FormTest.php index 39e0e5c7d7..5ac1f4c790 100644 --- a/mailpoet/tests/integration/Subscription/FormTest.php +++ b/mailpoet/tests/integration/Subscription/FormTest.php @@ -120,7 +120,7 @@ class FormTest extends \MailPoetTest { ], $this); $formController = new Form(ContainerWrapper::getInstance()->get(API::class), $urlHelper); $result = $formController->onSubmit($requestData); - expect($this->subscribersRepository->findAll())->isEmpty(); + verify($this->subscribersRepository->findAll())->empty(); verify($result['mailpoet_error'])->equals($this->form->getId()); verify($result['mailpoet_success'])->null(); } diff --git a/mailpoet/tests/integration/Tasks/SendingTest.php b/mailpoet/tests/integration/Tasks/SendingTest.php index ae805abe2d..f11e52bb23 100644 --- a/mailpoet/tests/integration/Tasks/SendingTest.php +++ b/mailpoet/tests/integration/Tasks/SendingTest.php @@ -66,7 +66,7 @@ class SendingTest extends \MailPoetTest { public function testItDeletesInvalidTasksWhenCreatingManyFromTasks() { $this->queue->delete(); $sendings = SendingTask::createManyFromTasks([$this->task]); - expect($sendings)->isEmpty(); + verify($sendings)->empty(); $task = ScheduledTask::findOne($this->task->id); $this->assertInstanceOf(ScheduledTask::class, $task); verify($task->status)->equals(ScheduledTask::STATUS_INVALID); @@ -115,7 +115,7 @@ class SendingTest extends \MailPoetTest { $this->sending->delete(); verify(ScheduledTask::findOne($this->task->id))->equals(false); verify(SendingQueue::findOne($this->queue->id))->equals(false); - expect(ScheduledTaskSubscriber::where('task_id', $this->task->id)->findMany())->isEmpty(); + verify(ScheduledTaskSubscriber::where('task_id', $this->task->id)->findMany())->empty(); } public function testItGetsSubscribers() { @@ -171,7 +171,7 @@ class SendingTest extends \MailPoetTest { // if task exists but sending queue is missing, results should not contain empty (false) values $this->queue->delete(); $tasks = $this->scheduledTaskRepository->findRunningSendingTasks(); - expect($tasks)->isEmpty(); + verify($tasks)->empty(); } public function testItGetsBatchOfScheduledQueues() { @@ -200,7 +200,7 @@ class SendingTest extends \MailPoetTest { // if task exists but sending queue is missing, results should not contain empty (false) values $this->queue->delete(); $tasks = $this->scheduledTaskRepository->findRunningSendingTasks(); - expect($tasks)->isEmpty(); + verify($tasks)->empty(); } public function testItGetsBatchOfRunningQueues() { diff --git a/mailpoet/tests/integration/Twig/FunctionsTest.php b/mailpoet/tests/integration/Twig/FunctionsTest.php index 11a912c27a..2f08646f91 100644 --- a/mailpoet/tests/integration/Twig/FunctionsTest.php +++ b/mailpoet/tests/integration/Twig/FunctionsTest.php @@ -19,6 +19,6 @@ class FunctionsTest extends \MailPoetTest { $resultRtl = $twig->render('template'); verify($resultRtl)->equals('rtl'); $resultNoRtl = $twig->render('template'); - expect($resultNoRtl)->isEmpty(); + verify($resultNoRtl)->empty(); } } diff --git a/mailpoet/tests/integration/Util/Notices/AfterMigrationNoticeTest.php b/mailpoet/tests/integration/Util/Notices/AfterMigrationNoticeTest.php index 820a510670..979bb61923 100644 --- a/mailpoet/tests/integration/Util/Notices/AfterMigrationNoticeTest.php +++ b/mailpoet/tests/integration/Util/Notices/AfterMigrationNoticeTest.php @@ -6,14 +6,14 @@ class AfterMigrationNoticeTest extends \MailPoetTest { public function testItDoesntDisplayIfShouldntDisplay() { $notice = new AfterMigrationNotice(); $result = $notice->init(false); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDoesntDisplayIfDisabled() { $notice = new AfterMigrationNotice(); $notice->disable(); $result = $notice->init(true); - expect($result)->isEmpty(); + verify($result)->empty(); } public function testItDisplayIfEnabled() { diff --git a/mailpoet/tests/unit/EmailEditor/Engine/Renderer/PreprocessorTest.php b/mailpoet/tests/unit/EmailEditor/Engine/Renderer/PreprocessorTest.php index 2a27002769..8a3abc1143 100644 --- a/mailpoet/tests/unit/EmailEditor/Engine/Renderer/PreprocessorTest.php +++ b/mailpoet/tests/unit/EmailEditor/Engine/Renderer/PreprocessorTest.php @@ -53,7 +53,7 @@ class PreprocessorTest extends \MailPoetUnitTest { verify($result[0]['innerBlocks'][0]['innerBlocks'][0]['blockName'])->equals('core/paragraph'); // Second columns remains empty verify($result[1]['innerBlocks'][0]['blockName'])->equals('core/column'); - expect($result[1]['innerBlocks'][0]['innerBlocks'])->isEmpty(); + verify($result[1]['innerBlocks'][0]['innerBlocks'])->empty(); // Third columns contain columns with two paragraph blocks verify($result[2]['innerBlocks'][0]['blockName'])->equals('core/column'); expect($result[2]['innerBlocks'][0]['innerBlocks'])->count(2); diff --git a/mailpoet/tests/unit/Entities/FormEntityTest.php b/mailpoet/tests/unit/Entities/FormEntityTest.php index 0b2b334c8f..f77b2977f4 100644 --- a/mailpoet/tests/unit/Entities/FormEntityTest.php +++ b/mailpoet/tests/unit/Entities/FormEntityTest.php @@ -73,7 +73,7 @@ class FormEntityTest extends \MailPoetUnitTest { $formEntity = new FormEntity('Test' ); $formEntity->setBody($this->body); $segmentIds = $formEntity->getSegmentBlocksSegmentIds(); - expect($segmentIds)->isEmpty(); + verify($segmentIds)->empty(); // Add segment selection block to second columns $body = $this->body; diff --git a/mailpoet/tests/unit/Features/FeaturesControllerTest.php b/mailpoet/tests/unit/Features/FeaturesControllerTest.php index cd6fcddc21..3e871a3dbf 100644 --- a/mailpoet/tests/unit/Features/FeaturesControllerTest.php +++ b/mailpoet/tests/unit/Features/FeaturesControllerTest.php @@ -70,6 +70,6 @@ class FeaturesControllerTest extends \MailPoetUnitTest { } catch (\RuntimeException $e) { verify($e->getMessage())->equals("Unknown feature 'feature-unknown'"); } - expect($controller->getAllFlags())->isEmpty(); + verify($controller->getAllFlags())->empty(); } }