Bugzilla – Attachment 66037 Details for
Bug 19004
Koha/Patrons.t fails when item-level_itypes is not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19004: Patrons.t should create its own data for enrollment fees.
SIGNED-OFF-Bug-19004-Patronst-should-create-its-ow.patch (text/plain), 2.06 KB, created by
Mark Tompsett
on 2017-08-15 18:38:43 UTC
(
hide
)
Description:
Bug 19004: Patrons.t should create its own data for enrollment fees.
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-08-15 18:38:43 UTC
Size:
2.06 KB
patch
obsolete
>From 1efaab317eacaede07a4b6b9f2dfedf651fbe79c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Sun, 30 Jul 2017 16:53:00 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 19004: Patrons.t should create its own data > for enrollment fees. > >If the patron categories J, K, YA would not exist, Patrons.t would fail. > >Test plan: >[1] Remove one of these patron categories. >[2] Run t/db_dependent/Koha/Patrons.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > t/db_dependent/Koha/Patrons.t | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 84c46ca..79c2231 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -32,6 +32,7 @@ use C4::Circulation; > use Koha::Holds; > use Koha::Patron; > use Koha::Patrons; >+use Koha::Patron::Categories; > use Koha::Database; > use Koha::DateUtils; > use Koha::Virtualshelves; >@@ -375,14 +376,13 @@ subtest "delete" => sub { > subtest 'add_enrolment_fee_if_needed' => sub { > plan tests => 4; > >- my $enrolmentfee_K = 5; >- my $enrolmentfee_J = 10; >- my $enrolmentfee_YA = 20; >- >- my $dbh = C4::Context->dbh; >- $dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_K, 'K'); >- $dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_J, 'J'); >- $dbh->do(q|UPDATE categories set enrolmentfee=? where categorycode=?|, undef, $enrolmentfee_YA, 'YA'); >+ my $enrolmentfees = { K => 5, J => 10, YA => 20 }; >+ foreach( keys %{$enrolmentfees} ) { >+ ( Koha::Patron::Categories->find( $_ ) // $builder->build_object({ class => 'Koha::Patron::Categories', value => { categorycode => $_ } }) )->enrolmentfee( $enrolmentfees->{$_} )->store; >+ } >+ my $enrolmentfee_K = $enrolmentfees->{K}; >+ my $enrolmentfee_J = $enrolmentfees->{J}; >+ my $enrolmentfee_YA = $enrolmentfees->{YA}; > > my %borrower_data = ( > firstname => 'my firstname', >-- >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 19004
:
65789
|
65790
|
66037
|
66038
|
66486
|
66546
|
66721
|
66722
|
66723