Bugzilla – Attachment 26685 Details for
Bug 9481
charge not showing fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9481 (QA follow-up) - Add unit test for GetItemCharges in C4::Overdues.
Bug-9481-QA-follow-up---Add-unit-test-for-GetItemC.patch (text/plain), 2.83 KB, created by
Holger Meißner
on 2014-03-28 14:17:00 UTC
(
hide
)
Description:
Bug 9481 (QA follow-up) - Add unit test for GetItemCharges in C4::Overdues.
Filename:
MIME Type:
Creator:
Holger Meißner
Created:
2014-03-28 14:17:00 UTC
Size:
2.83 KB
patch
obsolete
>From de286e44a816dd16f817a049385f6860e1c5e72c Mon Sep 17 00:00:00 2001 >From: Rafal Kopaczka <rkk0@poczta.onet.pl> >Date: Fri, 28 Mar 2014 10:00:36 +0100 >Subject: [PATCH] Bug 9481 (QA follow-up) - Add unit test for GetItemCharges > in C4::Overdues. >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Holger MeiÃner <h.meissner.82@web.de> >--- > t/db_dependent/Overdues.t | 80 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 80 insertions(+) > create mode 100644 t/db_dependent/Overdues.t > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >new file mode 100644 >index 0000000..43d290c >--- /dev/null >+++ b/t/db_dependent/Overdues.t >@@ -0,0 +1,80 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use C4::Members; >+use C4::Biblio; >+use C4::Items; >+ >+use Test::More tests => 3; >+ >+BEGIN { >+ use_ok('C4::Overdues'); >+} >+ >+my $dbh = C4::Context->dbh; >+ >+# Start transaction >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ >+#Populate database >+my $biblio = MARC::Record->new(); >+my $title = 'Title to add'; >+ >+$biblio->append_fields( >+ MARC::Field->new('100', ' ', ' ', a => 'Anonymous'), >+ MARC::Field->new('245', ' ', ' ', a => $title), >+); >+my ($biblionumber, $biblioitemnumber) = AddBiblio($biblio, ''); >+my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem( >+ { >+ homebranch => 'CPL', >+ holdingbranch => 'CPL', >+ barcode => 'T000001', >+ }, >+ $biblionumber >+); >+my ( $item_bibnum2, $item_bibitemnum2, $itemnumber2 ) = AddItem( >+ { >+ homebranch => 'CPL', >+ holdingbranch => 'CPL', >+ barcode => 'T000002', >+ }, >+ $biblionumber >+); >+ >+my $borrowernumber = AddMember( >+ firstname => 'my firstname', >+ surname => 'my surname', >+ categorycode => 'S', >+ branchcode => 'CPL', >+); >+ >+my $insertdb = q/ >+ INSERT INTO accountlines ( >+ borrowernumber, itemnumber, amount, >+ accounttype, amountoutstanding, timestamp ) >+ VALUES ( ?, ?, ?, ?, ?, CURRENT_TIMESTAMP )/; >+my @data = ( >+ [$borrowernumber, $itemnumber, 123.50, 'F', 123.45], >+ [$borrowernumber, $itemnumber, 12.34, 'FU', 123.45], >+ [$borrowernumber, $itemnumber, 123.45, 'Rent', 12.34], >+ [$borrowernumber, $itemnumber, 567.89, 'F', 89.01], >+ [$borrowernumber, $itemnumber2, 543.21, 'F', 543.21], >+ ); >+ >+my $sth = $dbh->prepare($insertdb); >+foreach my $loop (@data) { >+ $sth->execute(@$loop); >+} >+ >+ok(GetItemCharges($itemnumber, $borrowernumber) == 348.25, "GetItemCharges returns all outstanding charges for item"); >+ >+my $anotheritemnumber = $itemnumber + 999999; >+my $anotherborrowernumber = $borrowernumber + 999999; >+ok(GetItemCharges($anotheritemnumber, $anotherborrowernumber) == 0, "There's no charges for item"); >+ >+ >+$dbh->rollback; >+ >-- >1.7.10.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 9481
:
14816
|
14817
|
26193
|
26457
|
26674
|
26675
|
26684
|
26685
|
36739
|
36740
|
36742
|
36787
|
36848