Improve error reporting in API

[MAILPOET-1290]
This commit is contained in:
Pavel Dohnal
2018-06-12 10:13:49 +01:00
parent 8c55fce938
commit 71fed489ec
6 changed files with 85 additions and 9 deletions

View File

@ -250,7 +250,7 @@ class SchedulerTest extends \MailPoetTest {
);
// queue is created and scheduled for delivery one day later
Scheduler::scheduleSubscriberWelcomeNotification(
$result = Scheduler::scheduleSubscriberWelcomeNotification(
$subscriber_id = 10,
$segments = array(
3,
@ -263,6 +263,7 @@ class SchedulerTest extends \MailPoetTest {
->findOne();
expect(Carbon::parse($queue->scheduled_at)->format('Y-m-d H:i'))
->equals($current_time->addDay()->format('Y-m-d H:i'));
expect($result[0]->id())->equals($queue->id());
}
function itDoesNotScheduleAnythingWhenNewsletterDoesNotExist() {
@ -795,4 +796,4 @@ class SchedulerTest extends \MailPoetTest {
\ORM::raw_execute('TRUNCATE ' . SendingQueue::$_table);
\ORM::raw_execute('TRUNCATE ' . Subscriber::$_table);
}
}
}