Bugzilla – Attachment 20198 Details for
Bug 10699
DeleteBranchTransferLimits in C4/Circulation.pm needs return value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10699:DeleteBranchTransferLimits in C4/Circulation.pm needs return value
Bug-10699DeleteBranchTransferLimits-in-C4Circulati.patch (text/plain), 2.43 KB, created by
Chris Cormack
on 2013-08-08 22:37:17 UTC
(
hide
)
Description:
Bug 10699:DeleteBranchTransferLimits in C4/Circulation.pm needs return value
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-08-08 22:37:17 UTC
Size:
2.43 KB
patch
obsolete
>From df2dcb50f725649a071faf202babeab8a87b2788 Mon Sep 17 00:00:00 2001 >From: Kenza Zaki <kenza.zaki@biblibre.com> >Date: Thu, 8 Aug 2013 11:40:13 +0200 >Subject: [PATCH] Bug 10699:DeleteBranchTransferLimits in C4/Circulation.pm > needs return value > >This patch adds return values to DeleteBranchTransferLimits: >1 if a Transfer Limit is deleted >undef if no parameters is given >0E0 if a wrong parameter is given > >More, it fixes and adds some tests in t/db_dependent/Circulation_transfers.t > >To test : >prove t/db_dependent/Circulation_transfers.t >t/db_dependent/Circulation_transfers.t .. ok >All tests successful. >Files=1, Tests=14, 19 wallclock secs ( 0.02 usr 0.01 sys + 0.39 cusr 0.02 csys = 0.44 CPU) >Result: PASS > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > C4/Circulation.pm | 3 ++- > t/db_dependent/Circulation_transfers.t | 6 +++--- > 2 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ca66931..0fd482f 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3267,9 +3267,10 @@ Deletes all the branch transfer limits for one branch > > sub DeleteBranchTransferLimits { > my $branch = shift; >+ return unless $branch; > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("DELETE FROM branch_transfer_limits WHERE fromBranch = ?"); >- $sth->execute($branch); >+ return $sth->execute($branch); > } > > sub ReturnLostItem{ >diff --git a/t/db_dependent/Circulation_transfers.t b/t/db_dependent/Circulation_transfers.t >index 927b87c..c35a30a 100644 >--- a/t/db_dependent/Circulation_transfers.t >+++ b/t/db_dependent/Circulation_transfers.t >@@ -9,7 +9,7 @@ use C4::Circulation; > use Koha::DateUtils; > use DateTime::Duration; > >-use Test::More tests => 12; >+use Test::More tests => 14; > > BEGIN { > use_ok('C4::Circulation'); >@@ -184,8 +184,8 @@ is( > 1, > "A Branch TransferLimit has been deleted" > ); >-#FIXME :The following test should pass but doesn't because currently the routine DeleteBranchTransferLimit returns nothin >-#is(C4::Circulation::DeleteBranchTransferLimits(),undef,"Without parameters DeleteBranchTransferLimit returns undef"); >+is(C4::Circulation::DeleteBranchTransferLimits(),undef,"Without parameters DeleteBranchTransferLimit returns undef"); >+is(C4::Circulation::DeleteBranchTransferLimits('B'),'0E0',"With a wrong id DeleteBranchTransferLimit returns 0E0"); > > #Test DeleteTransfer > is( C4::Circulation::DeleteTransfer($item_id1), >-- >1.8.1.2
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 10699
:
20163
|
20198
|
20597