Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-04-23 15:29:46 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-27 21:51:36 +0300
commitf9a64d3e1bf35c704fcf2ec9151b947213917a90 (patch)
treecd51c8de8feec0763481c30dff022f00a92a5b62 /apps
parent8bf8e92092a545bcbd448cf3b360fa2822035b6b (diff)
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php9
-rw-r--r--apps/dav/tests/unit/CardDAV/CardDavBackendTest.php9
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')