- Deletes post notification history record when no posts are found and
when sending queue record is deleted - Reverts back changes to the model's delete() method - Updates unit tests
This commit is contained in:
@@ -74,15 +74,19 @@ class NewsletterTaskTest extends MailPoetTest {
|
||||
->notContains('[mailpoet_open_data]');
|
||||
}
|
||||
|
||||
function testReturnsFalseWhenNewsletterIsANotificationWithoutPosts() {
|
||||
function testItReturnsFalseAndDeletesNewsletterWhenPostNotificationContainsNoPostsn() {
|
||||
$newsletter = $this->newsletter;
|
||||
|
||||
$newsletter->type = Newsletter::TYPE_NOTIFICATION_HISTORY;
|
||||
// replace post id data tag with something else
|
||||
$newsletter->body = str_replace('data-post-id', 'id', $newsletter->body);
|
||||
$newsletter->save();
|
||||
// returned result is false
|
||||
$result = $this->newsletter_task->getAndPreProcess($this->queue);
|
||||
expect($result)->false();
|
||||
// newsletter is deleted
|
||||
$newsletter = Newsletter::findOne($newsletter->id);
|
||||
expect($newsletter)->false();
|
||||
}
|
||||
|
||||
function testItSavesNewsletterPosts() {
|
||||
|
Reference in New Issue
Block a user