Delete tasks without queues when fetching sending tasks

[MAILPOET-3379]
This commit is contained in:
wxa
2021-03-03 11:54:11 +03:00
committed by Veljko V
parent bf121c20b5
commit 3f7b809bd4
2 changed files with 19 additions and 0 deletions

View File

@ -58,6 +58,13 @@ class SendingTest extends \MailPoetTest {
expect($queue->taskId)->equals($this->task->id);
}
public function testItDeletesInvalidTasksWhenCreatingManyFromTasks() {
$this->queue->delete();
$sendings = SendingTask::createManyFromTasks([$this->task]);
expect($sendings)->isEmpty();
expect(ScheduledTask::findOne($this->task->id))->equals(false);
}
public function testItCanBeCreatedFromScheduledTask() {
$sending = SendingTask::createFromScheduledTask($this->task);
$queue = $sending->queue();