Skip the 'mark spammy subscribers' test if there is no user_status column [MAILPOET-2150]

This commit is contained in:
wxa
2019-07-08 21:20:34 +03:00
committed by M. Shull
parent ba5b1e9ee2
commit b4bebb24a9

View File

@@ -284,6 +284,12 @@ class WPTest extends \MailPoetTest {
function testItMarksSpammySubscribersWithUserStatus2AsUnconfirmed() {
global $wpdb;
$column_exists = $wpdb->query(sprintf('SHOW COLUMNS FROM `%s` LIKE "user_status"', $wpdb->users));
if (!$column_exists) {
// This column is deprecated in WP, is no longer used by the core
// and either may not be present, or may be removed in the future.
return false;
}
$random_number = rand();
$id = $this->insertUser($random_number);
$subscriber = Subscriber::createOrUpdate([