[stable-0.6] Catch exception during cron execution and log to d… (#1422)

[stable-0.6] Catch exception during cron execution and log to debug
This commit is contained in:
Julius Härtl
2019-12-30 09:34:26 +01:00
committed by GitHub
3 changed files with 23 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ use OCA\Deck\Db\BoardMapper;
use OCA\Deck\Db\Card;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\Notification\NotificationHelper;
use OCP\ILogger;
class ScheduledNoificationsTest extends \Test\TestCase {
@@ -35,6 +36,8 @@ class ScheduledNoificationsTest extends \Test\TestCase {
protected $cardMapper;
/** @var NotificationHelper|\PHPUnit\Framework\MockObject\MockObject */
protected $notificationHelper;
/** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var ScheduledNotifications */
protected $scheduledNotifications;
@@ -42,7 +45,8 @@ class ScheduledNoificationsTest extends \Test\TestCase {
parent::setUp();
$this->cardMapper = $this->createMock(CardMapper::class);
$this->notificationHelper = $this->createMock(NotificationHelper::class);
$this->scheduledNotifications = new ScheduledNotifications($this->cardMapper, $this->notificationHelper);
$this->logger = $this->createMock(ILogger::class);
$this->scheduledNotifications = new ScheduledNotifications($this->cardMapper, $this->notificationHelper, $this->logger);
}
public function testDeleteCron() {