@@ -68,7 +68,7 @@ public function testGetAccount()
68
68
/**
69
69
* Test that get_sequences() returns the expected data.
70
70
*
71
- * @since 1.0.
71
+ * @since 1.0.0
72
72
*
73
73
* @return void
74
74
*/
@@ -89,7 +89,7 @@ public function testGetSequences()
89
89
/**
90
90
* Test that get_sequence_subscriptions() returns the expected data.
91
91
*
92
- * @since 1.0.
92
+ * @since 1.0.0
93
93
*
94
94
* @return void
95
95
*/
@@ -115,7 +115,7 @@ public function testGetSequenceSubscriptions()
115
115
/**
116
116
* Test that get_sequence_subscriptions() returns the expected data in descending order.
117
117
*
118
- * @since 1.0.
118
+ * @since 1.0.0
119
119
*
120
120
* @return void
121
121
*/
@@ -141,7 +141,7 @@ public function testGetSequenceSubscriptionsWithDescSortOrder()
141
141
* Test that get_sequence_subscriptions() throws a ClientException when an invalid
142
142
* sequence ID is specified.
143
143
*
144
- * @since 1.0.
144
+ * @since 1.0.0
145
145
*
146
146
* @return void
147
147
*/
@@ -155,7 +155,7 @@ public function testGetSequenceSubscriptionsWithInvalidSequenceID()
155
155
* Test that get_sequence_subscriptions() throws a ClientException when an invalid
156
156
* sort order is specified.
157
157
*
158
- * @since 1.0.
158
+ * @since 1.0.0
159
159
*
160
160
* @return void
161
161
*/
@@ -168,7 +168,7 @@ public function testGetSequenceSubscriptionsWithInvalidSortOrder()
168
168
/**
169
169
* Test that add_subscriber_to_sequence() returns the expected data.
170
170
*
171
- * @since 1.0.
171
+ * @since 1.0.0
172
172
*
173
173
* @return void
174
174
*/
@@ -186,7 +186,7 @@ public function testAddSubscriberToSequence()
186
186
* Test that add_subscriber_to_sequence() throws a ClientException when an invalid
187
187
* sequence is specified.
188
188
*
189
- * @since 1.0.
189
+ * @since 1.0.0
190
190
*
191
191
* @return void
192
192
*/
@@ -200,7 +200,7 @@ public function testAddSubscriberToSequenceWithInvalidSequenceID()
200
200
* Test that add_subscriber_to_sequence() throws a ClientException when an invalid
201
201
* email address is specified.
202
202
*
203
- * @since 1.0.
203
+ * @since 1.0.0
204
204
*
205
205
* @return void
206
206
*/
@@ -213,7 +213,7 @@ public function testAddSubscriberToSequenceWithInvalidEmailAddress()
213
213
/**
214
214
* Test that add_tag() returns the expected data.
215
215
*
216
- * @since 1.0.
216
+ * @since 1.0.0
217
217
*
218
218
* @return void
219
219
*/
@@ -229,7 +229,7 @@ public function testAddTag()
229
229
/**
230
230
* Test that get_resources() for Forms returns the expected data.
231
231
*
232
- * @since 1.0.
232
+ * @since 1.0.0
233
233
*
234
234
* @return void
235
235
*/
@@ -242,7 +242,7 @@ public function testGetResourcesForms()
242
242
/**
243
243
* Test that get_resources() for Landing Pages returns the expected data.
244
244
*
245
- * @since 1.0.
245
+ * @since 1.0.0
246
246
*
247
247
* @return void
248
248
*/
@@ -255,7 +255,7 @@ public function testGetResourcesLandingPages()
255
255
/**
256
256
* Test that get_resources() for Subscription Forms returns the expected data.
257
257
*
258
- * @since 1.0.
258
+ * @since 1.0.0
259
259
*
260
260
* @return void
261
261
*/
@@ -268,7 +268,7 @@ public function testGetResourcesSubscriptionForms()
268
268
/**
269
269
* Test that get_resources() for Tags returns the expected data.
270
270
*
271
- * @since 1.0.
271
+ * @since 1.0.0
272
272
*
273
273
* @return void
274
274
*/
@@ -282,7 +282,7 @@ public function testGetResourcesTags()
282
282
* Test that get_resources() throws a ClientException when an invalid
283
283
* resource type is specified.
284
284
*
285
- * @since 1.0.
285
+ * @since 1.0.0
286
286
*
287
287
* @return void
288
288
*/
@@ -296,7 +296,7 @@ public function testGetResourcesInvalidResourceType()
296
296
/**
297
297
* Test that form_subscribe() and form_unsubscribe() returns the expected data.
298
298
*
299
- * @since 1.0.
299
+ * @since 1.0.0
300
300
*
301
301
* @return void
302
302
*/
@@ -326,7 +326,7 @@ public function testFormSubscribe()
326
326
* Test that form_subscribe() throws a ClientException when an invalid
327
327
* form ID is specified.
328
328
*
329
- * @since 1.0.
329
+ * @since 1.0.0
330
330
*
331
331
* @return void
332
332
*/
@@ -338,12 +338,52 @@ public function testFormSubscribeWithInvalidFormID()
338
338
]);
339
339
}
340
340
341
+ /**
342
+ * Test that get_subscriber_id() returns the expected data.
343
+ *
344
+ * @since 1.0.0
345
+ *
346
+ * @return void
347
+ */
348
+ public function testGetSubscriberID ()
349
+ {
350
+ $ subscriber_id = $ this ->api ->get_subscriber_id ($ _ENV ['CONVERTKIT_API_SUBSCRIBER_EMAIL ' ]);
351
+ $ this ->assertIsInt ($ subscriber_id );
352
+ $ this ->assertEquals ($ subscriber_id , (int ) $ _ENV ['CONVERTKIT_API_SUBSCRIBER_ID ' ]);
353
+ }
354
+
355
+ /**
356
+ * Test that get_subscriber_id() throws a ClientException when an invalid
357
+ * email address is specified.
358
+ *
359
+ * @since 1.0.0
360
+ *
361
+ * @return void
362
+ */
363
+ public function testGetSubscriberIDWithInvalidEmailAddress ()
364
+ {
365
+ $ this ->expectException (\InvalidArgumentException::class);
366
+ $ result = $ this ->api ->get_subscriber_id ('not-an-email-address ' );
367
+ }
341
368
369
+ /**
370
+ * Test that get_subscriber_id() return false when no subscriber found
371
+ * matching the given email address.
372
+ *
373
+ * @since 1.0.0
374
+ *
375
+ * @return void
376
+ */
377
+ public function testGetSubscriberIDWithNotSubscribedEmailAddress ()
378
+ {
379
+ $ result =
$ this ->
api ->
get_subscriber_id (
'[email protected] ' );
380
+ $ this ->assertFalse ($ result );
381
+ }
342
382
343
383
/**
344
384
* Test that get_subscriber() returns the expected data.
345
385
*
346
- * @since 1.0.
386
+ * @since 1.0.0
347
387
*
348
388
* @return void
349
389
*/
@@ -363,7 +403,7 @@ public function testGetSubscriber()
363
403
* Test that get_subscriber() throws a ClientException when an invalid
364
404
* subscriber ID is specified.
365
405
*
366
- * @since 1.0.
406
+ * @since 1.0.0
367
407
*
368
408
* @return void
369
409
*/
@@ -376,7 +416,7 @@ public function testGetSubscriberWithInvalidSubscriberID()
376
416
/**
377
417
* Test that get_subscriber_tags() returns the expected data.
378
418
*
379
- * @since 1.0.
419
+ * @since 1.0.0
380
420
*
381
421
* @return void
382
422
*/
@@ -391,7 +431,7 @@ public function testGetSubscriberTags()
391
431
* Test that get_subscriber_tags() throws a ClientException when an invalid
392
432
* subscriber ID is specified.
393
433
*
394
- * @since 1.0.
434
+ * @since 1.0.0
395
435
*
396
436
* @return void
397
437
*/
@@ -404,7 +444,7 @@ public function testGetSubscriberTagsWithInvalidSubscriberID()
404
444
/**
405
445
* Test that list_purchases() returns the expected data.
406
446
*
407
- * @since 1.0.
447
+ * @since 1.0.0
408
448
*
409
449
* @return void
410
450
*/
@@ -423,7 +463,7 @@ public function testListPurchases()
423
463
/**
424
464
* Test that create_purchase() returns the expected data.
425
465
*
426
- * @since 1.0.
466
+ * @since 1.0.0
427
467
*
428
468
* @return void
429
469
*/
0 commit comments