Contributors: Move user_registered check to pruning function.

That allows `add_user_data_to_xprofile()` to be reused in other contexts.

`user_login` was removed from the `SELECT` because it wasn't being used.
This commit is contained in:
Ian Dunn 2022-08-17 17:24:38 -07:00
parent 9c0d1371f3
commit c9783a17f5
2 changed files with 22 additions and 6 deletions

View file

@ -275,23 +275,33 @@ class Test_Contributor extends WP_UnitTestCase {
$contributors = array(
'active + due for email' => array(
'last_logged_in' => strtotime( '1 week ago' ),
'user_registered' => strtotime( '1 year ago' ),
'5ftf_last_inactivity_email' => 0,
),
'active + not due for email' => array(
'last_logged_in' => strtotime( '1 week ago' ),
'user_registered' => strtotime( '1 year ago' ),
'5ftf_last_inactivity_email' => strtotime( '1 month ago' ),
),
'inactive + due for email' => array(
'last_logged_in' => strtotime( '4 months ago' ),
'user_registered' => strtotime( '1 year ago' ),
'5ftf_last_inactivity_email' => strtotime( '4 months ago' ),
),
'inactive + not due for email' => array(
'last_logged_in' => strtotime( '4 months ago' ),
'user_registered' => strtotime( '1 year ago' ),
'5ftf_last_inactivity_email' => strtotime( '2 months ago' ),
),
'new user' => array(
'last_logged_in' => 0,
'user_registered' => strtotime( '1 week ago' ),
'5ftf_last_inactivity_email' => 0,
),
);
$expected = array( 'inactive + due for email' );