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 688-694
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
688 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous->{borrowernumber} ); |
688 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous->{borrowernumber} ); |
689 |
|
689 |
|
690 |
subtest 'patron privacy is 1 (default)' => sub { |
690 |
subtest 'patron privacy is 1 (default)' => sub { |
691 |
plan tests => 3; |
691 |
plan tests => 4; |
692 |
|
692 |
|
693 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
693 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
694 |
my $patron = $builder->build( |
694 |
my $patron = $builder->build( |
Lines 715-720
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
715 |
|
715 |
|
716 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
716 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
717 |
is( $returned, 1, 'The item should have been returned' ); |
717 |
is( $returned, 1, 'The item should have been returned' ); |
|
|
718 |
|
719 |
my $patron_to_anonymise = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11' )->search( { 'me.borrowernumber' => $patron->{borrowernumber} } )->next; |
720 |
is( ref($patron_to_anonymise), 'Koha::Patron', 'search_patrons_to_anonymise should return Koha::Patrons' ); |
721 |
|
718 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
722 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
719 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
723 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
720 |
|
724 |
|
721 |
- |
|
|