From b4bebb24a9edbb51eb454d904be9ea3522aabc5f Mon Sep 17 00:00:00 2001 From: wxa Date: Mon, 8 Jul 2019 21:20:34 +0300 Subject: [PATCH] Skip the 'mark spammy subscribers' test if there is no user_status column [MAILPOET-2150] --- tests/integration/Segments/WPTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/Segments/WPTest.php b/tests/integration/Segments/WPTest.php index fd1371ca5c..ddfff2aacc 100644 --- a/tests/integration/Segments/WPTest.php +++ b/tests/integration/Segments/WPTest.php @@ -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([