Replace expect()->isEmpty() with verify()->empty()
codeception/verify 2.1 removed support for expect()->isEmpty() so we need to replace it with verify()->empty(). [MAILPOET-5664]
This commit is contained in:
committed by
David Remer
parent
1865fc8930
commit
e4136fee8c
@ -103,7 +103,7 @@ class FeatureFlagsTest extends \MailPoetTest {
|
||||
]);
|
||||
|
||||
$endpoint = $this->createEndpointWithFeatureDefaults([]);
|
||||
expect($endpoint->getAll()->data)->isEmpty();
|
||||
verify($endpoint->getAll()->data)->empty();
|
||||
}
|
||||
|
||||
public function testItDoesNotSaveUnknownFlag() {
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
@ -169,7 +169,7 @@ class TranslationUpdaterTest extends \MailPoetTest {
|
||||
]
|
||||
);
|
||||
$result = $updater->checkForTranslations($updateTransient);
|
||||
expect($result->translations)->isEmpty();
|
||||
verify($result->translations)->empty();
|
||||
}
|
||||
|
||||
public function testItDoesNotOverrideNewerVersionInCaseItWasInstalledFromDotOrg(): void {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -75,7 +75,7 @@ class LogHandlerTest extends \MailPoetTest {
|
||||
]);
|
||||
|
||||
$log = $this->repository->findBy(['name' => 'old name']);
|
||||
expect($log)->isEmpty();
|
||||
verify($log)->empty();
|
||||
}
|
||||
|
||||
public function testItNotPurgesOldLogs() {
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
|
@ -64,7 +64,7 @@ class SubscriberCustomFieldTest extends \MailPoetTest {
|
||||
]
|
||||
);
|
||||
$records = SubscriberCustomField::findArray();
|
||||
expect($records)->isEmpty();
|
||||
verify($records)->empty();
|
||||
}
|
||||
|
||||
public function testItCanDeleteSubscriberRelations() {
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user