@@ -27,11 +27,14 @@ public function createContactList_Perfect_Perfect(): void
27
27
$ contactIds = [1 , 2 , 3 ];
28
28
$ this ->apiClient
29
29
->method ('post ' )
30
- ->with ($ this ->endPoints ->createContactList ($ this ->customerId ), [
31
- 'name ' => $ this ->listName ,
32
- 'key_id ' => 'id ' ,
33
- 'external_ids ' => $ contactIds ,
34
- ])
30
+ ->with (
31
+ "api_base_url/ $ this ->customerId /contactlist " ,
32
+ [
33
+ 'name ' => $ this ->listName ,
34
+ 'key_id ' => 'id ' ,
35
+ 'external_ids ' => $ contactIds ,
36
+ ]
37
+ )
35
38
->willReturn ($ this ->apiSuccess (['id ' => $ this ->contactListId ]));
36
39
37
40
$ contactListId = $ this ->listService ->createContactList ($ this ->customerId , $ this ->listName , $ contactIds );
@@ -88,7 +91,7 @@ public function getContactLists_Perfect_Perfect(): void
88
91
89
92
$ this ->apiClient
90
93
->method ('get ' )
91
- ->with ($ this ->endPoints -> contactLists ( $ this -> customerId ) )
94
+ ->with (" api_base_url/ $ this ->customerId /contactlist " )
92
95
->willReturn ($ this ->apiSuccess ($ contactLists ));
93
96
94
97
$ returnedContactLists = $ this ->listService ->getContactLists ($ this ->customerId );
@@ -109,7 +112,7 @@ public function findContactListByName_Perfect_Perfect(): void
109
112
110
113
$ this ->apiClient
111
114
->method ('get ' )
112
- ->with ($ this ->endPoints -> contactLists ( $ this -> customerId ) )
115
+ ->with (" api_base_url/ $ this ->customerId /contactlist " )
113
116
->willReturn ($ this ->apiSuccess ($ contactLists ));
114
117
115
118
$ contactListId = $ this ->listService ->findContactListByName ($ this ->customerId , $ this ->listName );
@@ -178,7 +181,7 @@ public function addToContactList_Perfect_Perfect(): void
178
181
->expects ($ this ->once ())
179
182
->method ('post ' )
180
183
->with (
181
- $ this ->endPoints -> addToContactList ( $ this -> customerId , $ this -> contactListId ) ,
184
+ " api_base_url/ $ this ->customerId /contactlist/654321/add " ,
182
185
[
183
186
'key_id ' => 'id ' ,
184
187
'external_ids ' => $ contactIds ,
@@ -211,7 +214,7 @@ public function replaceContactList_Perfect_Perfect(): void
211
214
$ this ->apiClient
212
215
->method ('post ' )
213
216
->with (
214
- $ this ->endPoints -> replaceContactList ( $ this -> customerId , $ this -> contactListId ) ,
217
+ " api_base_url/ $ this ->customerId /contactlist/654321/replace " ,
215
218
[
216
219
'key_id ' => 'id ' ,
217
220
'external_ids ' => $ contactIds ,
@@ -239,12 +242,12 @@ public function replaceContactList_ApiFailure_ThrowsException(): void
239
242
/**
240
243
* @test
241
244
*/
242
- public function getContactIdsInList_Perfect_Perfect (): void
245
+ public function getContactIdsInList_CalledWithProperUrl_ApiResponseConverted (): void
243
246
{
244
247
$ response = ['value ' => [1 , 2 , 3 ], 'next ' => null ];
245
248
$ this ->apiClient
246
249
->method ('get ' )
247
- ->with ($ this ->endPoints -> contactIdsInList ( $ this -> customerId , $ this ->contactListId ) )
250
+ ->with (" api_base_url/ $ this ->customerId /contactlist/ $ this ->contactListId /contactIds " )
248
251
->willReturn ($ this ->apiSuccess ($ response ));
249
252
250
253
$ result = $ this ->listService ->getContactIdsInList ($ this ->customerId , $ this ->contactListId );
@@ -273,7 +276,7 @@ public function getContactsOfList_Perfect_Perfect(): void
273
276
$ chunk = [1 , 2 , 3 ];
274
277
$ this ->apiClient
275
278
->method ('get ' )
276
- ->with ($ this ->endPoints -> contactsOfList ( $ this -> customerId , $ this -> contactListId , $ limit, $ offset) )
279
+ ->with (" api_base_url/ $ this ->customerId /contactlist/654321/contacts/? limit=100& offset=200 " )
277
280
->willReturn ($ this ->apiSuccess ($ chunk ));
278
281
279
282
$ result = $ this ->listService ->getContactsOfList ($ this ->customerId , $ this ->contactListId , $ limit , $ offset );
@@ -328,7 +331,7 @@ public function deleteContactsFromList_Perfect_Perfect(): void
328
331
->expects ($ this ->once ())
329
332
->method ('post ' )
330
333
->with (
331
- $ this ->endPoints -> deleteContactsFromList ( $ this -> customerId , $ this -> contactListId ) ,
334
+ " api_base_url/ $ this ->customerId /contactlist/654321/delete " ,
332
335
[
333
336
'key_id ' => 'id ' ,
334
337
'external_ids ' => $ contactIds ,
0 commit comments