From e8fd5fef17f7678eebb6ce444f256629a58fe6aa Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Fri, 15 May 2026 20:32:55 +0800 Subject: [PATCH] Tests: Fix `testCreateSubscriberWithInvalidCustomFields` --- tests/ConvertKitAPITest.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/ConvertKitAPITest.php b/tests/ConvertKitAPITest.php index 6c48680..23a03f1 100644 --- a/tests/ConvertKitAPITest.php +++ b/tests/ConvertKitAPITest.php @@ -3581,8 +3581,8 @@ public function testCreateSubscriberWithInvalidSubscriberState() } /** - * Test that create_subscriber() returns the expected data - * when an invalid custom field is included. + * Test that create_subscriber() throws a ClientException when an invalid + * custom field is included. * * @since 2.0.0 * @@ -3590,7 +3590,7 @@ public function testCreateSubscriberWithInvalidSubscriberState() */ public function testCreateSubscriberWithInvalidCustomFields() { - + $this->expectException(ClientException::class); $emailAddress = $this->generateEmailAddress(); $result = $this->api->create_subscriber( email_address: $emailAddress, @@ -3598,12 +3598,6 @@ public function testCreateSubscriberWithInvalidCustomFields() 'not_a_custom_field' => 'value' ] ); - - // Set subscriber_id to ensure subscriber is unsubscribed after test. - $this->subscriber_ids[] = $result->subscriber->id; - - // Assert subscriber exists with correct data. - $this->assertEquals($result->subscriber->email_address, $emailAddress); } /**