Replace expect()->notEquals() with verify()->notEquals()

codeception/verify 2.1 removed support for expect()->notEquals() so we need
to replace it with verify()->notEquals().

[MAILPOET-5664]
This commit is contained in:
Rodrigo Primo
2023-10-18 16:02:10 -03:00
committed by David Remer
parent 5d839277d6
commit 00c5250cff
21 changed files with 68 additions and 68 deletions

View File

@@ -345,7 +345,7 @@ class SendingQueueTest extends \MailPoetTest {
public function testItDeletesQueueWhenNewsletterIsNotFound() {
// queue exists
$queue = SendingQueue::findOne($this->queue->id);
expect($queue)->notEquals(false);
verify($queue)->notEquals(false);
// delete newsletter
$this->newslettersRepository->bulkDelete([$this->newsletter->id]);
@@ -455,7 +455,7 @@ class SendingQueueTest extends \MailPoetTest {
->where('subscriber_id', $this->subscriber->getId())
->where('queue_id', $this->queue->id)
->findOne();
expect($statistics)->notEquals(false);
verify($statistics)->notEquals(false);
}
public function testItSendCorrectDataToSubscribersOneByOne() {
@@ -583,7 +583,7 @@ class SendingQueueTest extends \MailPoetTest {
->where('subscriber_id', $this->subscriber->getId())
->where('queue_id', $this->queue->id)
->findOne();
expect($statistics)->notEquals(false);
verify($statistics)->notEquals(false);
}
public function testItProcessesStandardNewsletters() {
@@ -632,7 +632,7 @@ class SendingQueueTest extends \MailPoetTest {
->where('subscriber_id', $this->subscriber->getId())
->where('queue_id', $this->queue->id)
->findOne();
expect($statistics)->notEquals(false);
verify($statistics)->notEquals(false);
}
public function testItHandlesSendingErrorCorrectly() {
@@ -737,7 +737,7 @@ class SendingQueueTest extends \MailPoetTest {
$newQueue = ScheduledTask::findOne($this->queue->task_id);
$this->assertInstanceOf(ScheduledTask::class, $newQueue);
expect($newQueue->updatedAt)->notEquals($originalUpdated);
verify($newQueue->updatedAt)->notEquals($originalUpdated);
}
public function testItCanProcessWelcomeNewsletters() {
@@ -789,7 +789,7 @@ class SendingQueueTest extends \MailPoetTest {
->where('subscriber_id', $this->subscriber->getId())
->where('queue_id', $this->queue->id)
->findOne();
expect($statistics)->notEquals(false);
verify($statistics)->notEquals(false);
}
public function testItPreventsSendingWelcomeEmailWhenSubscriberIsUnsubscribed() {

View File

@@ -249,7 +249,7 @@ class NewsletterTest extends \MailPoetTest {
$result = $newsletterTask->preProcessNewsletter($this->newsletter, $this->sendingTask);
$newsletterPost = $newsletterPostRepository->findOneBy(['newsletter' => $this->newsletter->getId()]);
expect($newsletterPost)->isInstanceOf(NewsletterPostEntity::class);
expect($result)->notEquals(false);
verify($result)->notEquals(false);
$this->assertInstanceOf(NewsletterPostEntity::class, $newsletterPost);
verify($newsletterPost->getPostId())->equals('10');
}
@@ -294,7 +294,7 @@ class NewsletterTest extends \MailPoetTest {
$this->newsletterTask->markNewsletterAsSent($newsletter, $this->sendingTask);
$updatedNewsletter = $this->newslettersRepository->findOneById($newsletter->getId());
$this->assertInstanceOf(NewsletterEntity::class, $updatedNewsletter);
expect($updatedNewsletter->getStatus())->notEquals(NewsletterEntity::STATUS_SENT);
verify($updatedNewsletter->getStatus())->notEquals(NewsletterEntity::STATUS_SENT);
}
public function testItDoesNotRenderSubscriberShortcodeInSubjectWhenPreprocessingNewsletter() {
@@ -540,7 +540,7 @@ class NewsletterTest extends \MailPoetTest {
$newsletter->setSubject('Subject 2');
$this->entityManager->persist($newsletter);
$this->entityManager->flush();
expect($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $renderedNewsletters));
verify($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $renderedNewsletters));
}
public function testCampaignIdRevertsIfContentReverts() {
@@ -555,7 +555,7 @@ class NewsletterTest extends \MailPoetTest {
$updatedRenderedNewsletters = [
'text' => 'text body updated',
];
expect($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $updatedRenderedNewsletters));
verify($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $updatedRenderedNewsletters));
$newsletter->setSubject('Subject');
$this->entityManager->persist($newsletter);
$this->entityManager->flush();
@@ -568,7 +568,7 @@ class NewsletterTest extends \MailPoetTest {
$renderedNewsletters = [
'text' => 'text body',
];
expect($this->newsletterTask->calculateCampaignId($newsletter1, $renderedNewsletters))->notEquals($this->newsletterTask->calculateCampaignId($newsletter2, $renderedNewsletters));
verify($this->newsletterTask->calculateCampaignId($newsletter1, $renderedNewsletters))->notEquals($this->newsletterTask->calculateCampaignId($newsletter2, $renderedNewsletters));
}
public function testCampaignIdChangesIfImageChanges() {
@@ -582,7 +582,7 @@ class NewsletterTest extends \MailPoetTest {
'text' => '[alt text] Text',
'html' => '<img src="http://example.com/different-image-same-alt.jpg" alt="alt text"><p>Text</p>',
];
expect($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $renderedNewslettersDifferentImageSrc));
verify($originalCampaignId)->notEquals($this->newsletterTask->calculateCampaignId($newsletter, $renderedNewslettersDifferentImageSrc));
}
public function testPreProcessingSavesFilterSegmentData(): void {