Use processTaskStrategy() instead of custom logic in Migration worker
[MAILPOET-2538]
This commit is contained in:
committed by
Jack Kitterhing
parent
8a8b34e554
commit
ac794aaca2
@ -15,6 +15,9 @@ use MailPoet\Tasks\Sending as SendingTask;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class MigrationTest extends \MailPoetTest {
|
||||
/** @var Migration */
|
||||
private $worker;
|
||||
|
||||
function _before() {
|
||||
parent::_before();
|
||||
// Alter table to test migration
|
||||
@ -63,17 +66,15 @@ class MigrationTest extends \MailPoetTest {
|
||||
$this->worker->pauseSending();
|
||||
expect(MailerLog::isSendingPaused())->true();
|
||||
$task = $this->createScheduledTask();
|
||||
$result = $this->worker->prepareTask($task);
|
||||
expect($result)->false();
|
||||
$this->worker->prepareTask($task);
|
||||
expect(MailerLog::isSendingPaused())->false();
|
||||
}
|
||||
|
||||
function testItCompletesTaskIfThereIsNothingToMigrate() {
|
||||
SendingQueue::deleteMany();
|
||||
$task = $this->createScheduledTask();
|
||||
$result = $this->worker->prepareTask($task);
|
||||
$this->worker->prepareTask($task);
|
||||
expect(ScheduledTask::findOne($task->id)->status)->equals(ScheduledTask::STATUS_COMPLETED);
|
||||
expect($result)->false();
|
||||
}
|
||||
|
||||
function testItMigratesSendingQueuesAndSubscribers() {
|
||||
|
Reference in New Issue
Block a user