Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/Integration/APITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,7 @@ public function testCreateSubscriberWithInvalidSubscriberState()
}

/**
* Test that create_subscriber() returns the expected data
* Test that create_subscriber() returns a WP_Error
* when an invalid custom field is included.
*
* @since 2.0.0
Expand All @@ -3940,14 +3940,8 @@ public function testCreateSubscriberWithInvalidCustomFields()
'not_a_custom_field' => 'value',
]
);
$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);
$this->assertInstanceOf(\WP_Error::class, $result);
$this->assertEquals($result->get_error_code(), $this->errorCode);
}

/**
Expand Down
Loading