Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should...
commit3c61f95fb41152994ca2807eee87dc8e13ba219d
authorKenza Zaki <kenza.zaki@biblibre.com>
Wed, 7 Aug 2013 14:35:35 +0000 (7 16:35 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 28 Aug 2013 15:15:10 +0000 (28 15:15 +0000)
treed000143a189827a1042e360934d611e896a20ae5
parenta58c5334c96105315ee3bf1cbb62d8c1aab82f0c
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.
C4/Circulation.pm
t/db_dependent/Circulation_transfers.t