Lines 17-30
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 82; |
20 |
use Test::More tests => 84; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Data::Dumper; |
22 |
use Data::Dumper; |
23 |
use C4::Context; |
23 |
use C4::Context; |
24 |
use Koha::Database; |
24 |
use Koha::Database; |
25 |
use Koha::Holds; |
25 |
use Koha::Holds; |
26 |
use Koha::List::Patron; |
26 |
use Koha::List::Patron; |
27 |
|
27 |
use Koha::Patrons; |
28 |
|
28 |
|
29 |
use t::lib::Mocks; |
29 |
use t::lib::Mocks; |
30 |
use t::lib::TestBuilder; |
30 |
use t::lib::TestBuilder; |
Lines 387-392
$patstodel = GetBorrowersToExpunge( { last_seen => '2016-02-15' });
Link Here
|
387 |
is( scalar @$patstodel, 2, 'TrackLastPatronActivity - 2 patrons must be deleted' ); |
387 |
is( scalar @$patstodel, 2, 'TrackLastPatronActivity - 2 patrons must be deleted' ); |
388 |
$patstodel = GetBorrowersToExpunge( { last_seen => '2016-04-04' }); |
388 |
$patstodel = GetBorrowersToExpunge( { last_seen => '2016-04-04' }); |
389 |
is( scalar @$patstodel, 3, 'TrackLastPatronActivity - 3 patrons must be deleted' ); |
389 |
is( scalar @$patstodel, 3, 'TrackLastPatronActivity - 3 patrons must be deleted' ); |
|
|
390 |
my $patron2 = $builder->build({ source => 'Borrower', value => { lastseen => undef } }); |
391 |
t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '0' ); |
392 |
Koha::Patrons->find( $patron2->{borrowernumber} )->track_login; |
393 |
is( Koha::Patrons->find( $patron2->{borrowernumber} )->lastseen, undef, 'Lastseen should not be changed' ); |
394 |
Koha::Patrons->find( $patron2->{borrowernumber} )->track_login({ force => 1 }); |
395 |
isnt( Koha::Patrons->find( $patron2->{borrowernumber} )->lastseen, undef, 'Lastseen should be changed now' ); |
390 |
|
396 |
|
391 |
# Regression tests for BZ13502 |
397 |
# Regression tests for BZ13502 |
392 |
## Remove all entries with userid='' (should be only 1 max) |
398 |
## Remove all entries with userid='' (should be only 1 max) |
393 |
- |
|
|