@@ -755,6 +755,30 @@ public function testGetFormSubscriptions()
755
755
$ this ->assertPaginationExists ($ result );
756
756
}
757
757
758
+ /**
759
+ * Test that get_form_subscriptions() returns the expected data
760
+ * when the total count is included.
761
+ *
762
+ * @since 2.0.0
763
+ *
764
+ * @return void
765
+ */
766
+ public function testGetFormSubscriptionsWithTotalCount ()
767
+ {
768
+ $ result = $ this ->api ->get_form_subscriptions (
769
+ form_id: (int ) $ _ENV ['CONVERTKIT_API_FORM_ID ' ],
770
+ include_total_count: true
771
+ );
772
+
773
+ // Assert subscribers and pagination exist.
774
+ $ this ->assertDataExists ($ result , 'subscribers ' );
775
+ $ this ->assertPaginationExists ($ result );
776
+
777
+ // Assert total count is included.
778
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
779
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
780
+ }
781
+
758
782
/**
759
783
* Test that get_form_subscriptions() returns the expected data
760
784
* when a valid Form ID is specified and the subscription status
@@ -1022,6 +1046,29 @@ public function testGetSequences()
1022
1046
$ this ->assertArrayHasKey ('created_at ' , $ sequence );
1023
1047
}
1024
1048
1049
+ /**
1050
+ * Test that get_sequences() returns the expected data
1051
+ * when the total count is included.
1052
+ *
1053
+ * @since 2.0.0
1054
+ *
1055
+ * @return void
1056
+ */
1057
+ public function testGetSequencesWithTotalCount ()
1058
+ {
1059
+ $ result = $ this ->api ->get_sequences (
1060
+ include_total_count: true
1061
+ );
1062
+
1063
+ // Assert sequences and pagination exist.
1064
+ $ this ->assertDataExists ($ result , 'sequences ' );
1065
+ $ this ->assertPaginationExists ($ result );
1066
+
1067
+ // Assert total count is included.
1068
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
1069
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
1070
+ }
1071
+
1025
1072
/**
1026
1073
* Test that get_sequences() returns the expected data when
1027
1074
* pagination parameters and per_page limits are specified.
@@ -1205,6 +1252,30 @@ public function testGetSequenceSubscriptions()
1205
1252
$ this ->assertPaginationExists ($ result );
1206
1253
}
1207
1254
1255
+ /**
1256
+ * Test that get_sequence_subscriptions() returns the expected data
1257
+ * when the total count is included.
1258
+ *
1259
+ * @since 2.0.0
1260
+ *
1261
+ * @return void
1262
+ */
1263
+ public function testGetSequencesWithTotalCount ()
1264
+ {
1265
+ $ result = $ this ->api ->get_sequence_subscriptions (
1266
+ sequence_id: $ _ENV ['CONVERTKIT_API_SEQUENCE_ID ' ],
1267
+ include_total_count: true
1268
+ );
1269
+
1270
+ // Assert subscribers and pagination exist.
1271
+ $ this ->assertDataExists ($ result , 'subscribers ' );
1272
+ $ this ->assertPaginationExists ($ result );
1273
+
1274
+ // Assert total count is included.
1275
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
1276
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
1277
+ }
1278
+
1208
1279
/**
1209
1280
* Test that get_sequence_subscriptions() returns the expected data
1210
1281
* when a valid Sequence ID is specified and the subscription status
@@ -1470,6 +1541,29 @@ public function testGetTags()
1470
1541
$ this ->assertArrayHasKey ('created_at ' , $ tag );
1471
1542
}
1472
1543
1544
+ /**
1545
+ * Test that get_tags() returns the expected data
1546
+ * when the total count is included.
1547
+ *
1548
+ * @since 2.0.0
1549
+ *
1550
+ * @return void
1551
+ */
1552
+ public function testGetTagsWithTotalCount ()
1553
+ {
1554
+ $ result = $ this ->api ->get_tags (
1555
+ include_total_count: true
1556
+ );
1557
+
1558
+ // Assert tags and pagination exist.
1559
+ $ this ->assertDataExists ($ result , 'tags ' );
1560
+ $ this ->assertPaginationExists ($ result );
1561
+
1562
+ // Assert total count is included.
1563
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
1564
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
1565
+ }
1566
+
1473
1567
/**
1474
1568
* Test that get_tags() returns the expected data
1475
1569
* when pagination parameters and per_page limits are specified.
@@ -1948,6 +2042,30 @@ public function testGetTagSubscriptions()
1948
2042
$ this ->assertPaginationExists ($ result );
1949
2043
}
1950
2044
2045
+ /**
2046
+ * Test that get_tag_subscriptions() returns the expected data
2047
+ * when the total count is included.
2048
+ *
2049
+ * @since 2.0.0
2050
+ *
2051
+ * @return void
2052
+ */
2053
+ public function testGetTagSubscriptionsWithTotalCount ()
2054
+ {
2055
+ $ result = $ this ->api ->get_tag_subscriptions (
2056
+ tag_id: (int ) $ _ENV ['CONVERTKIT_API_TAG_ID ' ],
2057
+ include_total_count: true
2058
+ );
2059
+
2060
+ // Assert tags and pagination exist.
2061
+ $ this ->assertDataExists ($ result , 'tags ' );
2062
+ $ this ->assertPaginationExists ($ result );
2063
+
2064
+ // Assert total count is included.
2065
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
2066
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
2067
+ }
2068
+
1951
2069
/**
1952
2070
* Test that get_tag_subscriptions() returns the expected data
1953
2071
* when a valid Tag ID is specified and the subscription status
@@ -2346,6 +2464,29 @@ public function testGetSubscribers()
2346
2464
$ this ->assertPaginationExists ($ result );
2347
2465
}
2348
2466
2467
+ /**
2468
+ * Test that get_subscribers() returns the expected data
2469
+ * when the total count is included.
2470
+ *
2471
+ * @since 2.0.0
2472
+ *
2473
+ * @return void
2474
+ */
2475
+ public function testGetSubscribersWithTotalCount ()
2476
+ {
2477
+ $ result = $ this ->api ->get_subscribers (
2478
+ include_total_count: true
2479
+ );
2480
+
2481
+ // Assert subscribers and pagination exist.
2482
+ $ this ->assertDataExists ($ result , 'subscribers ' );
2483
+ $ this ->assertPaginationExists ($ result );
2484
+
2485
+ // Assert total count is included.
2486
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
2487
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
2488
+ }
2489
+
2349
2490
/**
2350
2491
* Test that get_subscribers() returns the expected data when
2351
2492
* searching by an email address.
@@ -3207,6 +3348,30 @@ public function testGetSubscriberTags()
3207
3348
$ this ->assertPaginationExists ($ result );
3208
3349
}
3209
3350
3351
+ /**
3352
+ * Test that get_subscriber_tags() returns the expected data
3353
+ * when the total count is included.
3354
+ *
3355
+ * @since 2.0.0
3356
+ *
3357
+ * @return void
3358
+ */
3359
+ public function testGetSubscriberTagsWithTotalCount ()
3360
+ {
3361
+ $ result = $ this ->api ->get_subscriber_tags (
3362
+ subscriber_id: (int ) $ _ENV ['CONVERTKIT_API_SUBSCRIBER_ID ' ],
3363
+ include_total_count: true
3364
+ );
3365
+
3366
+ // Assert tags and pagination exist.
3367
+ $ this ->assertDataExists ($ result , 'tags ' );
3368
+ $ this ->assertPaginationExists ($ result );
3369
+
3370
+ // Assert total count is included.
3371
+ $ this ->assertArrayHasKey ('total_count ' , get_object_vars ($ result ->pagination ));
3372
+ $ this ->assertGreaterThan (0 , $ result ->pagination ->total_count );
3373
+ }
3374
+
3210
3375
/**
3211
3376
* Test that get_subscriber_tags() throws a ClientException when an invalid
3212
3377
* subscriber ID is specified.
0 commit comments