I opted to remove testItDeletesQueueWhenNewsletterIsNotFound() as I
wasn't sure how to recreate this test using Doctrine and I found out
that it was actually not working. The call to
$this->newslettersRepository->bulkDelete() was deleting the sending
queue entry and not SendingQueue::deleteTaskIfNewsletterDoesNotExist().
[MAILPOET-5737]
This test was checking that the status of a welcome email is set to
`sent` after it is processed. Turns out this is not what should happen
and also not what is actually happen. The code only changes the status
of emails of the types standard and notification history:
7d43059f15/mailpoet/lib/Cron/Workers/SendingQueue/Tasks/Newsletter.php (L285-L286)
The test changes the type of the email to welcome
using Paris and never persists it to the database. The code mentioned
above that changes the status of the email uses Doctrine, so it was
still acting as if this was an standard email and not a welcome email.
To fix this problem, I updated the test to check if the status of the
welcome email is `active` and also made sure to persist the change to
the database and refresh the Doctrine entity.
[MAILPOET-5737]