Unify list vs segment naming with a rest of codebase

[MAILPOET-3418]
This commit is contained in:
Rostislav Wolny
2021-04-01 13:51:42 +02:00
committed by Veljko V
parent 3dc5c5ce80
commit 3d2c62fc16
4 changed files with 9 additions and 9 deletions

View File

@ -32,7 +32,7 @@ class SendingQueue {
public $batchSize;
const BATCH_SIZE = 20;
const TASK_BATCH_SIZE = 5;
const EMAIL_WITH_INVALID_LIST_OPTION = 'mailpoet_email_with_invalid_list';
const EMAIL_WITH_INVALID_SEGMENT_OPTION = 'mailpoet_email_with_invalid_segment';
/** @var StatsNotificationsScheduler */
public $statsNotificationsScheduler;
@ -131,7 +131,7 @@ class SendingQueue {
);
$queue->status = ScheduledTaskEntity::STATUS_PAUSED;
$queue->save();
$this->wp->setTransient(self::EMAIL_WITH_INVALID_LIST_OPTION, $newsletter->subject);
$this->wp->setTransient(self::EMAIL_WITH_INVALID_SEGMENT_OPTION, $newsletter->subject);
continue;
}

View File

@ -6,8 +6,8 @@ use MailPoet\Cron\Workers\SendingQueue\SendingQueue;
use MailPoet\WP\Functions as WPFunctions;
use MailPoet\WP\Notice;
class EmailWithInvalidListNotice {
const OPTION_NAME = SendingQueue::EMAIL_WITH_INVALID_LIST_OPTION;
class EmailWithInvalidSegmentNotice {
const OPTION_NAME = SendingQueue::EMAIL_WITH_INVALID_SEGMENT_OPTION;
/** @var WPFunctions */
private $wp;

View File

@ -35,7 +35,7 @@ class PermanentNotices {
/** @var DeprecatedShortcodeNotice */
private $deprecatedShortcodeNotice;
/** @var EmailWithInvalidListNotice */
/** @var EmailWithInvalidSegmentNotice */
private $emailWithInvalidListNotice;
public function __construct(WPFunctions $wp) {
@ -48,7 +48,7 @@ class PermanentNotices {
$this->blackFridayNotice = new BlackFridayNotice();
$this->headersAlreadySentNotice = new HeadersAlreadySentNotice(SettingsController::getInstance(), $wp);
$this->deprecatedShortcodeNotice = new DeprecatedShortcodeNotice();
$this->emailWithInvalidListNotice = new EmailWithInvalidListNotice($wp);
$this->emailWithInvalidListNotice = new EmailWithInvalidSegmentNotice($wp);
}
public function init() {
@ -112,7 +112,7 @@ class PermanentNotices {
case (DeprecatedShortcodeNotice::OPTION_NAME):
$this->deprecatedShortcodeNotice->disable();
break;
case (EmailWithInvalidListNotice::OPTION_NAME):
case (EmailWithInvalidSegmentNotice::OPTION_NAME):
$this->emailWithInvalidListNotice->disable();
break;
}

View File

@ -914,7 +914,7 @@ class SendingQueueTest extends \MailPoetTest {
$this->entityManager->refresh($newsletter);
expect($task->getStatus())->equals(ScheduledTaskEntity::STATUS_PAUSED);
expect($newsletter->getStatus())->equals(NewsletterEntity::STATUS_SENDING);
expect($this->wp->getTransient(SendingQueueWorker::EMAIL_WITH_INVALID_LIST_OPTION))->equals('Subject With Trashed');
expect($this->wp->getTransient(SendingQueueWorker::EMAIL_WITH_INVALID_SEGMENT_OPTION))->equals('Subject With Trashed');
}
public function testItPauseSendingTaskThatHasDeletedSegment() {
@ -936,7 +936,7 @@ class SendingQueueTest extends \MailPoetTest {
$this->entityManager->refresh($newsletter);
expect($task->getStatus())->equals(ScheduledTaskEntity::STATUS_PAUSED);
expect($newsletter->getStatus())->equals(NewsletterEntity::STATUS_SENDING);
expect($this->wp->getTransient(SendingQueueWorker::EMAIL_WITH_INVALID_LIST_OPTION))->equals('Subject With Deleted');
expect($this->wp->getTransient(SendingQueueWorker::EMAIL_WITH_INVALID_SEGMENT_OPTION))->equals('Subject With Deleted');
}
public function _after() {