diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-23 14:29:46 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-27 20:51:36 +0200 |
commit | f9a64d3e1bf35c704fcf2ec9151b947213917a90 (patch) | |
tree | cd51c8de8feec0763481c30dff022f00a92a5b62 /apps/dav | |
parent | 8bf8e92092a545bcbd448cf3b360fa2822035b6b (diff) | |
download | nextcloud-server-f9a64d3e1bf35c704fcf2ec9151b947213917a90.tar.gz nextcloud-server-f9a64d3e1bf35c704fcf2ec9151b947213917a90.zip |
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php | 9 | ||||
-rw-r--r-- | 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 310433f0913..681a159d833 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 63e090873bb..920e5a4ec1f 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') |