Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should...
authorKenza Zaki <kenza.zaki@biblibre.com>
Wed, 7 Aug 2013 14:35:35 +0000 (16:35 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 13 Sep 2013 17:39:47 +0000 (14:39 -0300)
commit0d97cee2f1b4eb9ca8e6ded917e019ea4bae68f5
treeb6ed4de8bc9281f70700d5fdd7c02c4019714c0d
parent637721585595de560ddaa48f2f93aef07bf0f65f
Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit

This patch test if the parameters $toBranch and $fromBranch are given.
If not, CreateBranchTransferLimit now returns undef.
This patch also fixes and adds some regression tests in
t/db_dependent/Circulation_transfers.t

NOTE:
Currently, we can add a transferlimit to nonexistent branches because
in the database branch_transfer_limits.toBranch
and branch_transfer_limits.fromBranch aren't foreign keys.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=15, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.42 cusr  0.00 csys =  0.45 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
(cherry picked from commit 3c61f95fb41152994ca2807eee87dc8e13ba219d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Circulation.pm
t/db_dependent/Circulation_transfers.t