Bugzilla – Attachment 36008 Details for
Bug 13455
Members/AddEnrolmentFeeIfNeeded.t requires sample data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13455: Members/AddEnrolmentFeeIfNeeded.t requires sample data
Bug-13455-MembersAddEnrolmentFeeIfNeededt-requires.patch (text/plain), 2.28 KB, created by
Magnus Enger
on 2015-02-18 21:16:35 UTC
(
hide
)
Description:
Bug 13455: Members/AddEnrolmentFeeIfNeeded.t requires sample data
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2015-02-18 21:16:35 UTC
Size:
2.28 KB
patch
obsolete
>From 9cac7bc25e9ea12ee36d2c81a8df56480aa36c26 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 12 Dec 2014 15:42:47 -0500 >Subject: [PATCH] Bug 13455: Members/AddEnrolmentFeeIfNeeded.t requires sample > data > >TEST PLAN >--------- >1) Make sure there are no 'J', 'K', nor 'YA' patron category codes. >2) Make sure there are no 'CPL' nor 'MPL' branch codes. >3) prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t > -- dies horribly >4) apply patch >5) prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t > -- passes >6) Run koha qa test tools > >Signed-off-by: Magnus Enger <magnus@enger.priv.no> >For me, the tests fail because I have a Norweian setup with different >categories etc. After applying the patch the tests pass. >--- > t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > >diff --git a/t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t b/t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t >index 46d9ec1..d530a1c 100644 >--- a/t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t >+++ b/t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t >@@ -3,11 +3,33 @@ use Test::More tests => 3; > > use C4::Context; > use C4::Members; >+use C4::Branch; > > my $dbh = C4::Context->dbh; > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > >+# Add branches if they don't exist >+if (not defined GetBranchDetail('CPL')) { >+ ModBranch({add => 1, branchcode => 'CPL', branchname => 'Centerville'}); >+} >+if (not defined GetBranchDetail('MPL')) { >+ ModBranch({add => 1, branchcode => 'MPL', branchname => 'Midway'}); >+} >+ >+# Add default categories. >+$dbh->do("DELETE FROM categories WHERE categorycode='K';"); >+$dbh->do("DELETE FROM categories WHERE categorycode='J';"); >+$dbh->do("DELETE FROM categories WHERE categorycode='YA';"); >+my $sql = "INSERT INTO categories (categorycode, description, >+ enrolmentperiod, upperagelimit, dateofbirthrequired, finetype, >+ bulk, enrolmentfee, overduenoticerequired, issuelimit, >+ reservefee, category_type) VALUES >+('K','Kid',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), >+('J','Juvenile',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), >+('YA','Young Adult',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C');"; >+$dbh->do($sql); >+ > my $enrolmentfee_K = 5; > my $enrolmentfee_J = 10; > my $enrolmentfee_YA = 20; >-- >1.9.1
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 13455
:
34370
| 36008