Bugzilla – Attachment 111058 Details for
Bug 26594
Patrons merge problem with restriction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26594: add Unit Test
Bug-26594-add-Unit-Test.patch (text/plain), 2.34 KB, created by
Fridolin Somers
on 2020-10-02 07:23:39 UTC
(
hide
)
Description:
Bug 26594: add Unit Test
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-10-02 07:23:39 UTC
Size:
2.34 KB
patch
obsolete
>From a858fd17bd85dce0e955ef967b1e805842c4ce4f Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 2 Oct 2020 09:22:36 +0200 >Subject: [PATCH] Bug 26594: add Unit Test > >Run prove t/db_dependent/Patron/Borrower_Debarments.t >--- > t/db_dependent/Patron/Borrower_Debarments.t | 35 ++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Patron/Borrower_Debarments.t b/t/db_dependent/Patron/Borrower_Debarments.t >index 144de3479e..c07b80935b 100755 >--- a/t/db_dependent/Patron/Borrower_Debarments.t >+++ b/t/db_dependent/Patron/Borrower_Debarments.t >@@ -8,7 +8,7 @@ use Koha::Patrons; > > use t::lib::TestBuilder; > >-use Test::More tests => 31; >+use Test::More tests => 33; > > use_ok('Koha::Patron::Debarments'); > >@@ -161,3 +161,36 @@ is( Koha::Patrons->find( $borrowernumber )->is_debarred, undef, 'A patron withou > > $dbh->do(q|UPDATE borrowers SET debarred = '9999-12-31'|); # Note: Change this test before the first of January 10000! > is( Koha::Patrons->find( $borrowernumber )->is_debarred, '9999-12-31', 'A patron with a debarred date in the future is debarred' ); >+ >+# Test patrons merge >+my $borrowernumber2 = Koha::Patron->new( >+ { >+ firstname => 'my firstname bis', >+ surname => 'my surname bis', >+ categorycode => $patron_category->{categorycode}, >+ branchcode => $library->{branchcode}, >+ } >+)->store->borrowernumber; >+my $debarreddate2 = '9999-06-10'; # Be sure to be in the future >+my $debarredcomment2 = 'Test merge'; >+AddDebarment( >+ { >+ borrowernumber => $borrowernumber2, >+ expiration => $debarreddate2, >+ type => 'MANUAL', >+ comment => $debarredcomment2, >+ } >+); >+my $borrowernumber3 = Koha::Patron->new( >+ { >+ firstname => 'my firstname ter', >+ surname => 'my surname ter', >+ categorycode => $patron_category->{categorycode}, >+ branchcode => $library->{branchcode}, >+ } >+)->store->borrowernumber; >+Koha::Patrons->find($borrowernumber3)->merge_with( [$borrowernumber2] ); >+is( Koha::Patrons->find($borrowernumber3)->debarred, >+ $debarreddate2, 'Koha::Patron->merge_with() transfers well debarred' ); >+is( Koha::Patrons->find($borrowernumber3)->debarredcomment, >+ $debarredcomment2, 'Koha::Patron->merge_with() transfers well debarredcomment' ); >-- >2.28.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 26594
:
111036
|
111058
|
111059
|
111197
|
111198
|
111702
|
111703
|
111704
|
112849
|
112850
|
113094