Bug 10683: add unit tests for CRUD routines in C4::Circulation
authorKenza Zaki <kenza.zaki@biblibre.com>
Wed, 28 Aug 2013 08:08:10 +0000 (10:08 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 9 Oct 2013 03:50:22 +0000 (03:50 +0000)
commit175cdb44f953044878194e3a0fb9193e0142db10
treea4dac64a0fcc67208c0d8c854082c2f5f47134ef
parentb6909640eff08c4ba946b50b46d8d561385321ff
Bug 10683: add unit tests for CRUD routines in C4::Circulation

This patch adds some unit tests wrapped in a transaction for
C4::Circulation.pm.

Circulation_Branch.t adds tests for routines which deal with
branch_item_rules,branch_borrower_circ_rules,
default_branch_circ_rules, default_circ_rules, and
 default_branch_item_rules in the database.

Circulation_issue.t adds tests for routines which deal with accountline
and issues in the database.

NOTE: Some commented tests have to be fixed, and some tests can be added.
More, other routines of Circulation.pm are tested in the patches:

10692 UT: Routines about transfers in Circulation.pm need unit tests
10710 UT : OfflineOperation's routines in C4/Circulation.t need unit tests
10767   UT: Routines which interact with the table issuingrules in C4/Circulation need unit test

Test plan:
prove t/db_dependent/Circulation_issue.t
t/db_dependent/Circulation_issue.t .. ok
All tests successful.
Files=1, Tests=16,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.40 cusr  0.02 csys =  0.44 CPU)
Result: PASS

prove t/db_dependent/Circulation_Branch.t
t/db_dependent/Circulation_Branch.t .. ok
All tests successful.
Files=1, Tests=10,  2 wallclock secs ( 0.06 usr  0.00 sys +  1.02 cusr  0.06 csys =  1.14 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Well, I don't know exactly what to do with this, so
I left it to QA

a) prove t/db_dependent/Circulation_Branch.t works well and without erros

b) prove t/db_dependent/Circulation_issue.t works without errors for me
ONLY if I have a issuingrule for All, All with 1 as renewals allowed, in
other cases it fails.

No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/db_dependent/Circulation_Branch.t [new file with mode: 0644]
t/db_dependent/Circulation_issue.t [new file with mode: 0644]