10
10
use OCA \DAV \CardDAV \AddressBook ;
11
11
use OCA \DAV \CardDAV \AddressBookImpl ;
12
12
use OCA \DAV \CardDAV \CardDavBackend ;
13
+ use OCA \DAV \Db \PropertyMapper ;
13
14
use OCP \IURLGenerator ;
14
15
use Sabre \VObject \Component \VCard ;
15
16
use Sabre \VObject \Property \Text ;
@@ -32,6 +33,9 @@ class AddressBookImplTest extends TestCase {
32
33
/** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */
33
34
private $ backend ;
34
35
36
+ /** @var PropertyMapper | \PHPUnit\Framework\MockObject\MockObject */
37
+ private $ propertyMapper ;
38
+
35
39
/** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
36
40
private $ vCard ;
37
41
@@ -50,12 +54,15 @@ protected function setUp(): void {
50
54
->disableOriginalConstructor ()->getMock ();
51
55
$ this ->vCard = $ this ->createMock (VCard::class);
52
56
$ this ->urlGenerator = $ this ->createMock (IURLGenerator::class);
57
+ $ this ->propertyMapper = $ this ->createMock (PropertyMapper::class);
53
58
54
59
$ this ->addressBookImpl = new AddressBookImpl (
55
60
$ this ->addressBook ,
56
61
$ this ->addressBookInfo ,
57
62
$ this ->backend ,
58
- $ this ->urlGenerator
63
+ $ this ->urlGenerator ,
64
+ $ this ->propertyMapper ,
65
+ null
59
66
);
60
67
}
61
68
@@ -78,6 +85,8 @@ public function testSearch(): void {
78
85
$ this ->addressBookInfo ,
79
86
$ this ->backend ,
80
87
$ this ->urlGenerator ,
88
+ $ this ->propertyMapper ,
89
+ null
81
90
]
82
91
)
83
92
->setMethods (['vCard2Array ' , 'readCard ' ])
@@ -124,6 +133,8 @@ public function testCreate($properties): void {
124
133
$ this ->addressBookInfo ,
125
134
$ this ->backend ,
126
135
$ this ->urlGenerator ,
136
+ $ this ->propertyMapper ,
137
+ null
127
138
]
128
139
)
129
140
->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' ])
@@ -174,6 +185,8 @@ public function testUpdate(): void {
174
185
$ this ->addressBookInfo ,
175
186
$ this ->backend ,
176
187
$ this ->urlGenerator ,
188
+ $ this ->propertyMapper ,
189
+ null
177
190
]
178
191
)
179
192
->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' , 'readCard ' ])
@@ -211,6 +224,8 @@ public function testUpdateWithTypes(): void {
211
224
$ this ->addressBookInfo ,
212
225
$ this ->backend ,
213
226
$ this ->urlGenerator ,
227
+ $ this ->propertyMapper ,
228
+ null
214
229
]
215
230
)
216
231
->setMethods (['vCard2Array ' , 'createUid ' , 'createEmptyVCard ' , 'readCard ' ])
@@ -292,6 +307,8 @@ public function testCreateUid(): void {
292
307
$ this ->addressBookInfo ,
293
308
$ this ->backend ,
294
309
$ this ->urlGenerator ,
310
+ $ this ->propertyMapper ,
311
+ null
295
312
]
296
313
)
297
314
->setMethods (['getUid ' ])
@@ -488,7 +505,9 @@ public function testIsSystemAddressBook(): void {
488
505
$ this ->addressBook ,
489
506
$ addressBookInfo ,
490
507
$ this ->backend ,
491
- $ this ->urlGenerator
508
+ $ this ->urlGenerator ,
509
+ $ this ->propertyMapper ,
510
+ null
492
511
);
493
512
494
513
$ this ->assertTrue ($ addressBookImpl ->isSystemAddressBook ());
@@ -507,7 +526,9 @@ public function testIsShared(): void {
507
526
$ this ->addressBook ,
508
527
$ addressBookInfo ,
509
528
$ this ->backend ,
510
- $ this ->urlGenerator
529
+ $ this ->urlGenerator ,
530
+ $ this ->propertyMapper ,
531
+ 'user2 '
511
532
);
512
533
513
534
$ this ->assertFalse ($ addressBookImpl ->isSystemAddressBook ());
@@ -527,7 +548,9 @@ public function testIsNotShared(): void {
527
548
$ this ->addressBook ,
528
549
$ addressBookInfo ,
529
550
$ this ->backend ,
530
- $ this ->urlGenerator
551
+ $ this ->urlGenerator ,
552
+ $ this ->propertyMapper ,
553
+ 'user2 '
531
554
);
532
555
533
556
$ this ->assertFalse ($ addressBookImpl ->isSystemAddressBook ());
0 commit comments