1010use OCA \DAV \CardDAV \AddressBook ;
1111use OCA \DAV \CardDAV \AddressBookImpl ;
1212use OCA \DAV \CardDAV \CardDavBackend ;
13+ use OCA \DAV \Db \PropertyMapper ;
1314use OCP \IURLGenerator ;
1415use Sabre \VObject \Component \VCard ;
1516use Sabre \VObject \Property \Text ;
@@ -32,6 +33,9 @@ class AddressBookImplTest extends TestCase {
3233 /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */
3334 private $ backend ;
3435
36+ /** @var PropertyMapper | \PHPUnit\Framework\MockObject\MockObject */
37+ private $ propertyMapper ;
38+
3539 /** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
3640 private $ vCard ;
3741
@@ -50,12 +54,15 @@ protected function setUp(): void {
5054 ->disableOriginalConstructor ()->getMock ();
5155 $ this ->vCard = $ this ->createMock (VCard::class);
5256 $ this ->urlGenerator = $ this ->createMock (IURLGenerator::class);
57+ $ this ->propertyMapper = $ this ->createMock (PropertyMapper::class);
5358
5459 $ this ->addressBookImpl = new AddressBookImpl (
5560 $ this ->addressBook ,
5661 $ this ->addressBookInfo ,
5762 $ this ->backend ,
58- $ this ->urlGenerator
63+ $ this ->urlGenerator ,
64+ $ this ->propertyMapper ,
65+ null
5966 );
6067 }
6168
@@ -78,6 +85,8 @@ public function testSearch(): void {
7885 $ this ->addressBookInfo ,
7986 $ this ->backend ,
8087 $ this ->urlGenerator ,
88+ $ this ->propertyMapper ,
89+ null
8190 ]
8291 )
8392 ->setMethods (['vCard2Array ' , 'readCard ' ])
@@ -124,6 +133,8 @@ public function testCreate($properties): void {
124133 $ this ->addressBookInfo ,
125134 $ this ->backend ,
126135 $ this ->urlGenerator ,
136+ $ this ->propertyMapper ,
137+ null
127138 ]
128139 )
129140 ->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' ])
@@ -174,6 +185,8 @@ public function testUpdate(): void {
174185 $ this ->addressBookInfo ,
175186 $ this ->backend ,
176187 $ this ->urlGenerator ,
188+ $ this ->propertyMapper ,
189+ null
177190 ]
178191 )
179192 ->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' , 'readCard ' ])
@@ -211,6 +224,8 @@ public function testUpdateWithTypes(): void {
211224 $ this ->addressBookInfo ,
212225 $ this ->backend ,
213226 $ this ->urlGenerator ,
227+ $ this ->propertyMapper ,
228+ null
214229 ]
215230 )
216231 ->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' , 'readCard ' ])
@@ -292,6 +307,8 @@ public function testCreateUid(): void {
292307 $ this ->addressBookInfo ,
293308 $ this ->backend ,
294309 $ this ->urlGenerator ,
310+ $ this ->propertyMapper ,
311+ null
295312 ]
296313 )
297314 ->setMethods (['getUid ' ])
@@ -488,7 +505,9 @@ public function testIsSystemAddressBook(): void {
488505 $ this ->addressBook ,
489506 $ addressBookInfo ,
490507 $ this ->backend ,
491- $ this ->urlGenerator
508+ $ this ->urlGenerator ,
509+ $ this ->propertyMapper ,
510+ null
492511 );
493512
494513 $ this ->assertTrue ($ addressBookImpl ->isSystemAddressBook ());
@@ -507,7 +526,9 @@ public function testIsShared(): void {
507526 $ this ->addressBook ,
508527 $ addressBookInfo ,
509528 $ this ->backend ,
510- $ this ->urlGenerator
529+ $ this ->urlGenerator ,
530+ $ this ->propertyMapper ,
531+ 'user2 '
511532 );
512533
513534 $ this ->assertFalse ($ addressBookImpl ->isSystemAddressBook ());
@@ -527,7 +548,9 @@ public function testIsNotShared(): void {
527548 $ this ->addressBook ,
528549 $ addressBookInfo ,
529550 $ this ->backend ,
530- $ this ->urlGenerator
551+ $ this ->urlGenerator ,
552+ $ this ->propertyMapper ,
553+ 'user2 '
531554 );
532555
533556 $ this ->assertFalse ($ addressBookImpl ->isSystemAddressBook ());
0 commit comments