From 7958e65f5233d9933694a63c591c15840a2a3a05 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 2 Jul 2026 18:25:04 +0800 Subject: [PATCH] Tests: Revert `testCreateSubscriberWithInvalidCustomFields` --- tests/Integration/APITest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Integration/APITest.php b/tests/Integration/APITest.php index 1620130..b4a9fc6 100644 --- a/tests/Integration/APITest.php +++ b/tests/Integration/APITest.php @@ -3924,7 +3924,7 @@ public function testCreateSubscriberWithInvalidSubscriberState() } /** - * Test that create_subscriber() returns a WP_Error + * Test that create_subscriber() returns the expected data * when an invalid custom field is included. * * @since 2.0.0 @@ -3940,8 +3940,14 @@ public function testCreateSubscriberWithInvalidCustomFields() 'not_a_custom_field' => 'value', ] ); - $this->assertInstanceOf(\WP_Error::class, $result); - $this->assertEquals($result->get_error_code(), $this->errorCode); + $this->assertNotInstanceOf(\WP_Error::class, $result); + $this->assertIsArray($result); + + // 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); } /**