Lines 618-624
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
618 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); |
618 |
t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); |
619 |
|
619 |
|
620 |
subtest 'AnonymousPatron is not defined' => sub { |
620 |
subtest 'AnonymousPatron is not defined' => sub { |
621 |
plan tests => 3; |
621 |
plan tests => 4; |
622 |
|
622 |
|
623 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
623 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
624 |
my $patron = $builder->build( |
624 |
my $patron = $builder->build( |
Lines 645-650
subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub {
Link Here
|
645 |
|
645 |
|
646 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
646 |
my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); |
647 |
is( $returned, 1, 'The item should have been returned' ); |
647 |
is( $returned, 1, 'The item should have been returned' ); |
|
|
648 |
|
649 |
my $patron_to_anonymise = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11' )->search( { 'me.borrowernumber' => $patron->{borrowernumber} } )->next; |
650 |
is( ref($patron_to_anonymise), 'Koha::Patron', 'search_patrons_to_anonymise should return Koha::Patrons' ); |
651 |
|
648 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
652 |
my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( '2010-10-11')->anonymise_issue_history('2010-10-11'); |
649 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
653 |
ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); |
650 |
|
654 |
|
651 |
- |
|
|