Bug 12457: Adding unit tests for Members.pm
authorYohann Dufour <dufour.yohann@gmail.com>
Mon, 23 Jun 2014 14:00:58 +0000 (16:00 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 30 Jul 2014 12:50:27 +0000 (09:50 -0300)
commit5f74170e68269360de848314a1e5ce0723ac672f
tree0bab0bd8991146659d8a3fa286bc9fe6607e2ca7
parent093ba1d9b7c8e15a8ee536c8f4aacbee10348065
Bug 12457: Adding unit tests for Members.pm

Adding unit tests for the routines AddMessage, GetMessages, GetMessagesCount and DeleteMessage in t/db_dependent/Members.t
Adding unit tests for the routines GetPendingIssues and GetAllIssues in separate files : t/db_dependent/Members/GetPendingIssues.t and t/db_dependent/Members/GetAllIssues.t
The routine GetAllIssues has been modified because it does not test if the arguments was defined :
- the borrowernumber argument is required
- if the order argument is not given, it takes a value by default : 'date_due desc'
- the limit argument is optional

Test plan:
1/ Apply the patch
2/ Execute : prove t/db_dependent/Members.t t/db_dependent/Members/GetAllIssues.t t/db_dependent/Members/GetPendingIssues.t
3/ The result has to be a success without error or warning :
t/db_dependent/Members.t ................... ok
t/db_dependent/Members/GetAllIssues.t ...... ok
t/db_dependent/Members/GetPendingIssues.t .. ok
All tests successful.
Files=3, Tests=83,  5 wallclock secs ( 0.06 usr  0.01 sys +  4.68 cusr  0.26 csys =  5.01 CPU)
Result: PASS

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: perltidy on t/db_dependent/Members/*

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Members.pm
t/db_dependent/Members.t
t/db_dependent/Members/GetAllIssues.t [new file with mode: 0644]
t/db_dependent/Members/GetPendingIssues.t [new file with mode: 0644]