Lines 1399-1406
$nb_of_patrons = Koha::Patrons->search->count;
Link Here
|
1399 |
$retrieved_patron_1->delete; |
1399 |
$retrieved_patron_1->delete; |
1400 |
is( Koha::Patrons->search->count, $nb_of_patrons - 1, 'Delete should have deleted the patron' ); |
1400 |
is( Koha::Patrons->search->count, $nb_of_patrons - 1, 'Delete should have deleted the patron' ); |
1401 |
|
1401 |
|
1402 |
subtest 'Log cardnumber change' => sub { |
1402 |
subtest 'BorrowersLog tests' => sub { |
1403 |
plan tests => 3; |
1403 |
plan tests => 4; |
1404 |
|
1404 |
|
1405 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
1405 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
1406 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1406 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
Lines 1414-1419
subtest 'Log cardnumber change' => sub {
Link Here
|
1414 |
is( $log_info->{cardnumber}->{after}, 'TESTCARDNUMBER', 'Got correct new cardnumber' ); |
1414 |
is( $log_info->{cardnumber}->{after}, 'TESTCARDNUMBER', 'Got correct new cardnumber' ); |
1415 |
is( $log_info->{cardnumber}->{before}, $cardnumber, 'Got correct old cardnumber' ); |
1415 |
is( $log_info->{cardnumber}->{before}, $cardnumber, 'Got correct old cardnumber' ); |
1416 |
is( scalar @logs, 1, 'With BorrowerLogs, one detailed MODIFY action should be logged for the modification.' ); |
1416 |
is( scalar @logs, 1, 'With BorrowerLogs, one detailed MODIFY action should be logged for the modification.' ); |
|
|
1417 |
|
1418 |
t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', 1 ); |
1419 |
$patron->track_login(); |
1420 |
@logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'MODIFY', object => $patron->borrowernumber } ); |
1421 |
is( scalar @logs, 1, 'With BorrowerLogs and TrackLastPatronActivity we should not spam the logs'); |
1417 |
}; |
1422 |
}; |
1418 |
|
1423 |
|
1419 |
$schema->storage->txn_rollback; |
1424 |
$schema->storage->txn_rollback; |
1420 |
- |
|
|