From 65fbb1596b45a4e11fe7e8667c71a4cccb6bffab Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 11 Jun 2026 17:49:48 +0100 Subject: [PATCH 1/2] Fix Sequence Email Test --- tests/ConvertKitAPITest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ConvertKitAPITest.php b/tests/ConvertKitAPITest.php index cb07ce6..6b013f0 100644 --- a/tests/ConvertKitAPITest.php +++ b/tests/ConvertKitAPITest.php @@ -1755,7 +1755,7 @@ public function testCreateGetUpdateAndDeleteSequenceEmail() preview_text: 'Test Preview Text', content: 'Test Content', email_template_id: (int) $_ENV['CONVERTKIT_API_EMAIL_TEMPLATE_ID'], - published: false, + published: true, send_days: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'], position: 0 ); @@ -1770,7 +1770,7 @@ public function testCreateGetUpdateAndDeleteSequenceEmail() $this->assertEquals('Test Preview Text', $result['preview_text']); $this->assertEquals('Test Content', $result['content']); $this->assertEquals((int) $_ENV['CONVERTKIT_API_EMAIL_TEMPLATE_ID'], $result['email_template_id']); - $this->assertEquals(false, $result['published']); + $this->assertEquals(true, $result['published']); $this->assertEquals(['monday', 'tuesday', 'wednesday', 'thursday', 'friday'], $result['send_days']); $this->assertEquals(2, $result['position']); From e4cdea0e6fd19de4b6789df172e290d31171d10a Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 11 Jun 2026 18:16:31 +0100 Subject: [PATCH 2/2] Fix `testCreateSubscriberWithInvalidCustomFields` test The API now returns a `warnings` array rather than throwing a ClientException --- tests/ConvertKitAPITest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ConvertKitAPITest.php b/tests/ConvertKitAPITest.php index 6b013f0..b791d55 100644 --- a/tests/ConvertKitAPITest.php +++ b/tests/ConvertKitAPITest.php @@ -4329,8 +4329,8 @@ public function testCreateSubscriberWithInvalidSubscriberState() } /** - * Test that create_subscriber() throws a ClientException when an invalid - * custom field is included. + * Test that create_subscriber() returns the expected warnings + * when an invalid custom field is included. * * @since 2.0.0 * @@ -4338,7 +4338,6 @@ public function testCreateSubscriberWithInvalidSubscriberState() */ public function testCreateSubscriberWithInvalidCustomFields() { - $this->expectException(ClientException::class); $emailAddress = $this->generateEmailAddress(); $result = $this->api->create_subscriber( email_address: $emailAddress, @@ -4346,6 +4345,7 @@ public function testCreateSubscriberWithInvalidCustomFields() 'not_a_custom_field' => 'value' ] ); + $this->assertArrayHasKey('warnings', get_object_vars($result)); } /**