diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-10-22 12:16:58 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-11-27 17:14:18 +0100 |
commit | ea117bac315b10ad50cb6bdcc56799842d59ad25 (patch) | |
tree | 39e5c37bffdcb81fd5f7b0914d66bf13681d128d /apps/dav/tests | |
parent | f700cd14fa4f094b7822edcf2e1a74b7f44ae32b (diff) | |
download | nextcloud-server-ea117bac315b10ad50cb6bdcc56799842d59ad25.tar.gz nextcloud-server-ea117bac315b10ad50cb6bdcc56799842d59ad25.zip |
catch errors when parsing calendar data for calendar query requests
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php | 6 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php index 90bf860b24d..2a01bd425c0 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php @@ -28,6 +28,7 @@ namespace OCA\DAV\Tests\unit\CalDAV; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Connector\Sabre\Principal; use OCP\IGroupManager; +use OCP\ILogger; use OCP\IUserManager; use OCP\Security\ISecureRandom; use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet; @@ -57,6 +58,8 @@ abstract class AbstractCalDavBackend extends TestCase { /** @var ISecureRandom */ private $random; + /** @var ILogger */ + private $logger; const UNIT_TEST_USER = 'principals/users/caldav-unit-test'; const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1'; @@ -84,7 +87,8 @@ abstract class AbstractCalDavBackend extends TestCase { $db = \OC::$server->getDatabaseConnection(); $this->random = \OC::$server->getSecureRandom(); - $this->backend = new CalDavBackend($db, $this->principal, $this->userManager, $this->groupManager, $this->random, $this->dispatcher); + $this->logger = $this->createMock(ILogger::class); + $this->backend = new CalDavBackend($db, $this->principal, $this->userManager, $this->groupManager, $this->random, $this->logger, $this->dispatcher); $this->cleanUpBackend(); } diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index 82f4161c206..57707c6c0a4 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -34,6 +34,7 @@ use OCP\IGroupManager; use OCP\IL10N; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\PublicCalendarRoot; +use OCP\ILogger; use OCP\IUserManager; use OCP\Security\ISecureRandom; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -64,6 +65,8 @@ class PublicCalendarRootTest extends TestCase { /** @var ISecureRandom */ private $random; + /** @var ILogger */ + private $logger; public function setUp() { parent::setUp(); @@ -73,6 +76,7 @@ class PublicCalendarRootTest extends TestCase { $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->random = \OC::$server->getSecureRandom(); + $this->logger = $this->createMock(ILogger::class); $dispatcher = $this->createMock(EventDispatcherInterface::class); $this->principal->expects($this->any())->method('getGroupMembership') @@ -85,6 +89,7 @@ class PublicCalendarRootTest extends TestCase { $this->userManager, $this->groupManager, $this->random, + $this->logger, $dispatcher ); |