Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 20; |
22 |
use Test::More tests => 21; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
use DateTime; |
24 |
use DateTime; |
25 |
|
25 |
|
Lines 686-692
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
686 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous->{borrowernumber} ); |
686 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous->{borrowernumber} ); |
687 |
|
687 |
|
688 |
subtest 'patron privacy is 1 (default)' => sub { |
688 |
subtest 'patron privacy is 1 (default)' => sub { |
689 |
plan tests => 3; |
689 |
plan tests => 4; |
690 |
|
690 |
|
691 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
691 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
692 |
my $patron = $builder->build( |
692 |
my $patron = $builder->build( |
Lines 713-718
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
713 |
|
713 |
|
714 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
714 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
715 |
is( $returned, 1, 'The item should have been returned' ); |
715 |
is( $returned, 1, 'The item should have been returned' ); |
|
|
716 |
|
717 |
my $patron_to_anonymise = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11' )->search( { 'me.borrowernumber' => $patron->{borrowernumber} } )->next; |
718 |
is( ref($patron_to_anonymise), 'Koha::Patron', 'search_patrons_to_anonymise should return Koha::Patrons' ); |
719 |
|
716 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
720 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
717 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
721 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
718 |
|
722 |
|
719 |
- |
|
|