AddOfflineOperation, GetOfflineOperation, GetOfflineOperations, DeleteOfflineOperation need unit tests.
Created attachment 20267 [details] [review] Bug 10710 : OfflineOperation's routines in C4/Circulation.pm need unit tests. This patch test AddOfflineOperation,GetOfflineOperation and DeleteOfflineOperation in C4/Circulation.pm. The tests are wrap in a transaction. Note: Currently, GetOfflineOperations is not tested because we cannot mock C4::Context->userenv in unit tests To test: prove t/db_dependent/Circulation_OfflineOperation.t t/db_dependent/Circulation_OfflineOperation.t .. ok All tests successful. Files=1, Tests=7, 19 wallclock secs ( 0.01 usr 0.01 sys + 0.33 cusr 0.02 csys = 0.37 CPU
Created attachment 20349 [details] [review] Bug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm This patch test AddOfflineOperation,GetOfflineOperation and DeleteOfflineOperation in C4/Circulation.pm. The tests are wrapped in a transaction. Note: Currently, GetOfflineOperations is not tested because we cannot mock C4::Context->userenv in unit tests To test: prove t/db_dependent/Circulation_OfflineOperation.t t/db_dependent/Circulation_OfflineOperation.t .. ok All tests successful. Files=1, Tests=7, 19 wallclock secs ( 0.01 usr 0.01 sys + 0.33 cusr 0.02 csys = 0.37 CPU Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Created attachment 20350 [details] [review] Bug 10710: (follow-up) perltidy new code Also, I prefer the use of parentheses for function calls, even when no arguments are being passed. One missed comma turns is(GetOfflineOperation, ...) into is(GetOfflineOperation ...) Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Created attachment 20598 [details] [review] [PASSED QA] Bug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm This patch test AddOfflineOperation,GetOfflineOperation and DeleteOfflineOperation in C4/Circulation.pm. The tests are wrapped in a transaction. Note: Currently, GetOfflineOperations is not tested because we cannot mock C4::Context->userenv in unit tests To test: prove t/db_dependent/Circulation_OfflineOperation.t t/db_dependent/Circulation_OfflineOperation.t .. ok All tests successful. Files=1, Tests=7, 19 wallclock secs ( 0.01 usr 0.01 sys + 0.33 cusr 0.02 csys = 0.37 CPU Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 20599 [details] [review] [PASSED QA] Bug 10710: (follow-up) perltidy new code Also, I prefer the use of parentheses for function calls, even when no arguments are being passed. One missed comma turns is(GetOfflineOperation, ...) into is(GetOfflineOperation ...) Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Pushed to master. Thanks, Kenza!
This patch has been pushed to 3.12.x, will be in 3.12.5. Thanks Kenza!