Bugzilla – Attachment 51469 Details for
Bug 16504
All borrower attribute values for a given code deleted if that attribute has branch limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16504: Add regression tests
Bug-16504-Add-regression-tests.patch (text/plain), 2.37 KB, created by
Jonathan Druart
on 2016-05-13 14:00:43 UTC
(
hide
)
Description:
Bug 16504: Add regression tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-13 14:00:43 UTC
Size:
2.37 KB
patch
obsolete
>From 697624925b48adf4310ac92b5d1bf34913e462e5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 13 May 2016 14:42:52 +0100 >Subject: [PATCH] Bug 16504: Add regression tests > >--- > t/db_dependent/Members/Attributes.t | 34 +++++++++++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Members/Attributes.t b/t/db_dependent/Members/Attributes.t >index f38ae41..e2ab1fe 100644 >--- a/t/db_dependent/Members/Attributes.t >+++ b/t/db_dependent/Members/Attributes.t >@@ -25,7 +25,7 @@ use C4::Members::AttributeTypes; > use Koha::Database; > use t::lib::TestBuilder; > >-use Test::More tests => 53; >+use Test::More tests => 55; > > use_ok('C4::Members::Attributes'); > >@@ -220,3 +220,35 @@ is( $borrower_attributes->[0]->{value}, $attributes->[1]->{value}, 'DeleteBorrow > C4::Members::Attributes::DeleteBorrowerAttribute($borrowernumber, $attributes->[1]); > $borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber); > is( @$borrower_attributes, 1, 'DeleteBorrowerAttribute deletes a borrower attribute' ); >+ >+# Regression tests for bug 16504 >+C4::Context->set_userenv(123, 'userid', 'usercnum', 'First name', 'Surname', $new_library->{branchcode}, 'My Library', 0); >+my $another_patron = $builder->build( >+ { source => 'Borrower', >+ value => { >+ firstname => 'my another firstname', >+ surname => 'my another surname', >+ categorycode => 'S', >+ branchcode => $new_library->{branchcode}, >+ } >+ } >+); >+$attributes = [ >+ { >+ value => 'my attribute1', >+ code => $attribute_type1->code(), >+ }, >+ { >+ value => 'my attribute2', >+ code => $attribute_type2->code(), >+ }, >+ { >+ value => 'my attribute limited', >+ code => $attribute_type_limited->code(), >+ } >+]; >+C4::Members::Attributes::SetBorrowerAttributes($another_patron->{borrowernumber}, $attributes); >+$borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($another_patron->{borrowernumber}); >+is( @$borrower_attributes, 3, 'SetBorrowerAttributes should have added the 3 attributes for another patron'); >+$borrower_attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber); >+is( @$borrower_attributes, 1, 'SetBorrowerAttributes should not have removed the attributes of other patrons' ); >-- >2.7.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 16504
:
51469
|
51470
|
51508
|
51509
|
51923
|
51924
|
51925