Bugzilla – Attachment 90904 Details for
Bug 22944
avoid AnonymousPatron in search_patrons_to_anonymise
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22944: change unit tests
Bug-22944-change-unit-tests.patch (text/plain), 2.46 KB, created by
Nick Clemens (kidclamp)
on 2019-06-21 12:13:27 UTC
(
hide
)
Description:
Bug 22944: change unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-06-21 12:13:27 UTC
Size:
2.46 KB
patch
obsolete
>From c9005b0825cef31944a2df849d6f48655e212c92 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 21 May 2019 11:17:11 +0200 >Subject: [PATCH] Bug 22944: change unit tests > >Add a dedicated UT and correct a test return value > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/Patrons.t | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index c9dd9c9306..993329980a 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -827,7 +827,7 @@ subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub { > t::lib::Mocks::mock_preference( 'AnonymousPatron', $anonymous->{borrowernumber} ); > > subtest 'patron privacy is 1 (default)' => sub { >- plan tests => 8; >+ plan tests => 9; > > t::lib::Mocks::mock_preference('IndependentBranches', 0); > my $patron = $builder->build( >@@ -878,6 +878,9 @@ subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub { > my $rows_affected = Koha::Patrons->search_patrons_to_anonymise( { before => '2011-11-12' } )->anonymise_issue_history( { before => '2010-10-11' } ); > ok( $rows_affected > 0, 'AnonymiseIssueHistory should affect at least 1 row' ); > >+ $patrons_to_anonymise = Koha::Patrons->search_patrons_to_anonymise( { before => '2010-10-11' } ); >+ is( $patrons_to_anonymise->count, 0, 'search_patrons_to_anonymise should return 0 after anonymisation is done' ); >+ > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare(q|SELECT borrowernumber FROM old_issues where itemnumber = ?|); > $sth->execute($item_1->{itemnumber}); >@@ -935,7 +938,7 @@ subtest 'search_patrons_to_anonymise & anonymise_issue_history' => 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::Patrons->search_patrons_to_anonymise( { before => '2010-10-11' } )->anonymise_issue_history( { before => '2010-10-11' } ); >- ok( $rows_affected > 0, 'AnonymiseIssueHistory should not return any error if success' ); >+ is( $rows_affected, 0, 'AnonymiseIssueHistory should not return any error if success' ); > > my $dbh = C4::Context->dbh; > my ($borrowernumber_used_to_anonymised) = $dbh->selectrow_array(q| >-- >2.11.0
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 22944
:
89932
|
89933
|
90488
|
90628
| 90904 |
90905
|
90906