Bugzilla – Attachment 131239 Details for
Bug 30007
Make ->anonymize methods throw an exception if AnonymousPatron is not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30007: (follow-up) Adjust Koha::Patrons->search_patrons_to_anonymise tests
Bug-30007-follow-up-Adjust-KohaPatrons-searchpatro.patch (text/plain), 2.24 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-03-02 12:20:19 UTC
(
hide
)
Description:
Bug 30007: (follow-up) Adjust Koha::Patrons->search_patrons_to_anonymise tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-03-02 12:20:19 UTC
Size:
2.24 KB
patch
obsolete
>From 40cc7c32832c9b711d0a8256f324e26ac4c31067 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 2 Mar 2022 09:19:55 -0300 >Subject: [PATCH] Bug 30007: (follow-up) Adjust > Koha::Patrons->search_patrons_to_anonymise tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Patrons.t | 20 ++++---------------- > 1 file changed, 4 insertions(+), 16 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index e7c49fc14e..54add04d60 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1172,7 +1172,8 @@ subtest 'search_patrons_to_anonymise' => sub { > t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); > > subtest 'AnonymousPatron is not defined' => sub { >- plan tests => 3; >+ >+ plan tests => 2; > > t::lib::Mocks::mock_preference('IndependentBranches', 0); > my $patron = $builder->build( >@@ -1192,22 +1193,9 @@ subtest 'search_patrons_to_anonymise' => sub { > > my ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->barcode, undef, undef, dt_from_string('2010-10-10') ); > is( $returned, 1, 'The item should have been returned' ); >- my $rows_affected = Koha::Old::Checkouts->search( >- { >- borrowernumber => [ >- Koha::Patrons->search_patrons_to_anonymise( >- { before => '2010-10-11' } >- )->get_column('borrowernumber') >- ] >- } >- )->anonymize; >- ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); >+ my $patrons_to_anonymize = Koha::Patrons->search_patrons_to_anonymise( { before => '2010-10-11' } ); >+ ok( $patrons_to_anonymize->count > 0, 'search_patrons_to_anonymize' ); > >- my $dbh = C4::Context->dbh; >- my ($borrowernumber_used_to_anonymised) = $dbh->selectrow_array(q| >- SELECT borrowernumber FROM old_issues where itemnumber = ? >- |, undef, $item->itemnumber); >- is( $borrowernumber_used_to_anonymised, undef, 'With AnonymousPatron is not defined, the issue should have been anonymised anyway' ); > Koha::Patrons->find( $patron->{borrowernumber})->delete; > }; > >-- >2.35.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30007
:
130163
|
130164
|
130165
|
130175
|
130176
|
130177
|
130272
|
130273
|
130274
| 131239 |
131298