From f9a64d3e1bf35c704fcf2ec9151b947213917a90 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 23 Apr 2018 14:29:46 +0200 Subject: [PATCH] Fix tests Signed-off-by: Roeland Jago Douma --- apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php | 9 ++++++++- apps/dav/tests/unit/CardDAV/CardDavBackendTest.php | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php index 310433f091..681a159d83 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php @@ -30,7 +30,9 @@ use OCA\DAV\Connector\Sabre\Principal; use OCP\IGroupManager; use OCP\ILogger; use OCP\IUserManager; +use OCP\IUserSession; use OCP\Security\ISecureRandom; +use OCP\Share\IManager as ShareManager; use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; @@ -73,7 +75,12 @@ abstract class AbstractCalDavBackend extends TestCase { $this->groupManager = $this->createMock(IGroupManager::class); $this->dispatcher = $this->createMock(EventDispatcherInterface::class); $this->principal = $this->getMockBuilder(Principal::class) - ->disableOriginalConstructor() + ->setConstructorArgs([ + $this->userManager, + $this->groupManager, + $this->createMock(ShareManager::class), + $this->createMock(IUserSession::class), + ]) ->setMethods(['getPrincipalByPath', 'getGroupMembership']) ->getMock(); $this->principal->expects($this->any())->method('getPrincipalByPath') diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 63e090873b..920e5a4ec1 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -40,6 +40,8 @@ use OCP\IDBConnection; use OCP\IGroupManager; use OCP\IL10N; use OCP\IUserManager; +use OCP\IUserSession; +use OCP\Share\IManager as ShareManager; use Sabre\DAV\PropPatch; use Sabre\VObject\Component\VCard; use Sabre\VObject\Property\Text; @@ -90,7 +92,12 @@ class CardDavBackendTest extends TestCase { $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->principal = $this->getMockBuilder(Principal::class) - ->disableOriginalConstructor() + ->setConstructorArgs([ + $this->userManager, + $this->groupManager, + $this->createMock(ShareManager::class), + $this->createMock(IUserSession::class), + ]) ->setMethods(['getPrincipalByPath', 'getGroupMembership']) ->getMock(); $this->principal->method('getPrincipalByPath')