aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CardDAV/AddressBookImplTest.php31
-rw-r--r--apps/dav/tests/unit/CardDAV/ContactsManagerTest.php4
2 files changed, 30 insertions, 5 deletions
diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
index dff368b923c..a8bfc1b41fd 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
@@ -10,6 +10,7 @@ namespace OCA\DAV\Tests\unit\CardDAV;
use OCA\DAV\CardDAV\AddressBook;
use OCA\DAV\CardDAV\AddressBookImpl;
use OCA\DAV\CardDAV\CardDavBackend;
+use OCA\DAV\Db\PropertyMapper;
use OCP\IURLGenerator;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Property\Text;
@@ -32,6 +33,9 @@ class AddressBookImplTest extends TestCase {
/** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */
private $backend;
+ /** @var PropertyMapper | \PHPUnit\Framework\MockObject\MockObject */
+ private $propertyMapper;
+
/** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
private $vCard;
@@ -50,12 +54,15 @@ class AddressBookImplTest extends TestCase {
->disableOriginalConstructor()->getMock();
$this->vCard = $this->createMock(VCard::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
+ $this->propertyMapper = $this->createMock(PropertyMapper::class);
$this->addressBookImpl = new AddressBookImpl(
$this->addressBook,
$this->addressBookInfo,
$this->backend,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->propertyMapper,
+ null
);
}
@@ -78,6 +85,8 @@ class AddressBookImplTest extends TestCase {
$this->addressBookInfo,
$this->backend,
$this->urlGenerator,
+ $this->propertyMapper,
+ null
]
)
->setMethods(['vCard2Array', 'readCard'])
@@ -124,6 +133,8 @@ class AddressBookImplTest extends TestCase {
$this->addressBookInfo,
$this->backend,
$this->urlGenerator,
+ $this->propertyMapper,
+ null
]
)
->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard'])
@@ -174,6 +185,8 @@ class AddressBookImplTest extends TestCase {
$this->addressBookInfo,
$this->backend,
$this->urlGenerator,
+ $this->propertyMapper,
+ null
]
)
->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard'])
@@ -211,6 +224,8 @@ class AddressBookImplTest extends TestCase {
$this->addressBookInfo,
$this->backend,
$this->urlGenerator,
+ $this->propertyMapper,
+ null
]
)
->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard'])
@@ -292,6 +307,8 @@ class AddressBookImplTest extends TestCase {
$this->addressBookInfo,
$this->backend,
$this->urlGenerator,
+ $this->propertyMapper,
+ null
]
)
->setMethods(['getUid'])
@@ -488,7 +505,9 @@ class AddressBookImplTest extends TestCase {
$this->addressBook,
$addressBookInfo,
$this->backend,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->propertyMapper,
+ null
);
$this->assertTrue($addressBookImpl->isSystemAddressBook());
@@ -507,7 +526,9 @@ class AddressBookImplTest extends TestCase {
$this->addressBook,
$addressBookInfo,
$this->backend,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->propertyMapper,
+ 'user2'
);
$this->assertFalse($addressBookImpl->isSystemAddressBook());
@@ -527,7 +548,9 @@ class AddressBookImplTest extends TestCase {
$this->addressBook,
$addressBookInfo,
$this->backend,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->propertyMapper,
+ 'user2'
);
$this->assertFalse($addressBookImpl->isSystemAddressBook());
diff --git a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php
index 6b1abb2718d..80f1f2a4445 100644
--- a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php
+++ b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php
@@ -9,6 +9,7 @@ namespace OCA\DAV\Tests\unit\CardDAV;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\CardDAV\ContactsManager;
+use OCA\DAV\Db\PropertyMapper;
use OCP\Contacts\IManager;
use OCP\IL10N;
use OCP\IURLGenerator;
@@ -25,9 +26,10 @@ class ContactsManagerTest extends TestCase {
$backEnd->method('getAddressBooksForUser')->willReturn([
['{DAV:}displayname' => 'Test address book', 'uri' => 'default'],
]);
+ $propertyMapper = $this->createMock(PropertyMapper::class);
$l = $this->createMock(IL10N::class);
- $app = new ContactsManager($backEnd, $l);
+ $app = new ContactsManager($backEnd, $l, $propertyMapper);
$app->setupContactsProvider($cm, 'user01', $urlGenerator);
}
}