Fix tests

[MAILPOET-1571]
This commit is contained in:
Pavel Dohnal
2019-01-15 14:43:16 +01:00
parent 1db75f40fb
commit b66c724c4a
8 changed files with 94 additions and 51 deletions

View File

@ -90,9 +90,11 @@ class Worker {
private function getNewsletter(ScheduledTask $task) {
$statsNotificationModel = $task->statsNotification()->findOne();
return $statsNotificationModel
->newsletter()
->findOne()
$newsletter = $statsNotificationModel->newsletter()->findOne();
if(!$newsletter) {
throw new \Exception('Newsletter not found');
}
return $newsletter
->withSendingQueue()
->withTotalSent()
->withStatistics();