Bugzilla – Attachment 60712 Details for
Bug 18169
Date like 2999 should not be used arbitrarily
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18169: Add test without before parameter for search_patrons_to_anonymise
Bug-18169-Add-test-without-before-parameter-for-se.patch (text/plain), 2.21 KB, created by
Jonathan Druart
on 2017-02-27 13:28:45 UTC
(
hide
)
Description:
Bug 18169: Add test without before parameter for search_patrons_to_anonymise
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-02-27 13:28:45 UTC
Size:
2.21 KB
patch
obsolete
>From a40f8964c65e2b56b6f398afcaae9598ac42aa21 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 27 Feb 2017 13:28:20 +0000 >Subject: [PATCH] Bug 18169: Add test without before parameter for > search_patrons_to_anonymise > >--- > t/db_dependent/Koha/Patrons.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 7fac24e..24a4a3d 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -688,7 +688,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 => 6; >+ plan tests => 8; > > t::lib::Mocks::mock_preference('IndependentBranches', 0); > my $patron = $builder->build( >@@ -753,6 +753,17 @@ subtest 'search_patrons_to_anonymise & anonymise_issue_history' => sub { > ($borrowernumber_used_to_anonymised) = $sth->fetchrow_array; > is( $borrowernumber_used_to_anonymised, $anonymous->{borrowernumber}, 'The issue should have been anonymised, the returned date is before' ); > >+ my $sth_reset = $dbh->prepare(q|UPDATE old_issues SET borrowernumber = ? WHERE itemnumber = ?|); >+ $sth_reset->execute( $patron->{borrowernumber}, $item_1->{itemnumber} ); >+ $sth_reset->execute( $patron->{borrowernumber}, $item_2->{itemnumber} ); >+ $rows_affected = Koha::Patrons->search_patrons_to_anonymise->anonymise_issue_history; >+ $sth->execute($item_1->{itemnumber}); >+ ($borrowernumber_used_to_anonymised) = $sth->fetchrow_array; >+ is( $borrowernumber_used_to_anonymised, $anonymous->{borrowernumber}, 'The issue 1 should have been anonymised, before parameter was not passed' ); >+ $sth->execute($item_2->{itemnumber}); >+ ($borrowernumber_used_to_anonymised) = $sth->fetchrow_array; >+ is( $borrowernumber_used_to_anonymised, $anonymous->{borrowernumber}, 'The issue 2 should have been anonymised, before parameter was not passed' ); >+ > Koha::Patrons->find( $patron->{borrowernumber})->delete; > }; > >-- >2.1.4
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 18169
:
60655
|
60712
|
60713
|
60714