Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 76; |
20 |
use Test::More tests => 79; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Data::Dumper; |
22 |
use Data::Dumper; |
23 |
use C4::Context; |
23 |
use C4::Context; |
Lines 353-361
is( scalar(@$patstodel),2,'Borrowers without issues deleted by expiration_date a
Link Here
|
353 |
$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); |
353 |
$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); |
354 |
is( scalar(@$patstodel),2,'Borrowers without issues deleted by last issue date'); |
354 |
is( scalar(@$patstodel),2,'Borrowers without issues deleted by last issue date'); |
355 |
|
355 |
|
356 |
|
356 |
# Test GetBorrowersToExpunge and TrackLastPatronActivity |
357 |
|
357 |
$dbh->do(q|UPDATE borrowers SET lastseen=NULL|); |
358 |
|
358 |
$builder->build({ source => 'Borrower', value => { lastseen => '2016-01-01 01:01:01', guarantorid => undef } } ); |
|
|
359 |
$builder->build({ source => 'Borrower', value => { lastseen => '2016-02-02 02:02:02', guarantorid => undef } } ); |
360 |
$builder->build({ source => 'Borrower', value => { lastseen => '2016-03-03 03:03:03', guarantorid => undef } } ); |
361 |
$patstodel = GetBorrowersToExpunge( { last_seen => '1999-12-12' }); |
362 |
is( scalar @$patstodel, 0, 'TrackLastPatronActivity - 0 patrons must be deleted' ); |
363 |
$patstodel = GetBorrowersToExpunge( { last_seen => '2016-02-15' }); |
364 |
is( scalar @$patstodel, 2, 'TrackLastPatronActivity - 2 patrons must be deleted' ); |
365 |
$patstodel = GetBorrowersToExpunge( { last_seen => '2016-04-04' }); |
366 |
is( scalar @$patstodel, 3, 'TrackLastPatronActivity - 3 patrons must be deleted' ); |
359 |
|
367 |
|
360 |
# Regression tests for BZ13502 |
368 |
# Regression tests for BZ13502 |
361 |
## Remove all entries with userid='' (should be only 1 max) |
369 |
## Remove all entries with userid='' (should be only 1 max) |
362 |
- |
|
|