|
Lines 1254-1260
subtest "filter_by_last_update" => sub {
Link Here
|
| 1254 |
class => 'Koha::Patrons', |
1254 |
class => 'Koha::Patrons', |
| 1255 |
value => { updated_on => $now->clone->subtract( days => $i ) } |
1255 |
value => { updated_on => $now->clone->subtract( days => $i ) } |
| 1256 |
} |
1256 |
} |
| 1257 |
)->borrowernumber; |
1257 |
)->borrowernumber; |
| 1258 |
} |
1258 |
} |
| 1259 |
|
1259 |
|
| 1260 |
my $patrons = Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } ); |
1260 |
my $patrons = Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } ); |
|
Lines 1274-1279
subtest "filter_by_last_update" => sub {
Link Here
|
| 1274 |
my $count = $patrons->filter_by_last_update( { timestamp_column_name => 'updated_on', days => 2 } )->count; |
1274 |
my $count = $patrons->filter_by_last_update( { timestamp_column_name => 'updated_on', days => 2 } )->count; |
| 1275 |
is( $count, 3, '3 patrons have been updated before the last 2 days (exclusive)' ); |
1275 |
is( $count, 3, '3 patrons have been updated before the last 2 days (exclusive)' ); |
| 1276 |
|
1276 |
|
|
|
1277 |
$count = $patrons->filter_by_last_update( { timestamp_column_name => 'updated_on', exact_days => 2 } )->count; |
| 1278 |
is( $count, 1, '1 patron has been updated 2 days ago' ); |
| 1279 |
|
| 1277 |
$count = $patrons->filter_by_last_update( { timestamp_column_name => 'updated_on', min_days => 2 } )->count; |
1280 |
$count = $patrons->filter_by_last_update( { timestamp_column_name => 'updated_on', min_days => 2 } )->count; |
| 1278 |
is( $count, 4, '4 patrons have been updated before the last 2 days (inclusive)' ); |
1281 |
is( $count, 4, '4 patrons have been updated before the last 2 days (inclusive)' ); |
| 1279 |
|
1282 |
|
| 1280 |
- |
|
|