Created attachment 20460 [details] [review] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests The test are wrap in a transaction. Note : The last test (in comment) currently doesn't pass because it needs some modifications of delete_report. To test: prove t/db_dependent/Reports_Guided.t t/db_dependent/Reports_Guided.t .. ok All tests successful. Files=1, Tests=7, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.28 cusr 0.02 csys = 0.32 CPU) Result: PASS
Created attachment 20464 [details] [review] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests The test are wrap in a transaction. Note : The last test (in comment) currently doesn't pass because it needs some modifications of delete_report. To test: prove t/db_dependent/Reports_Guided.t t/db_dependent/Reports_Guided.t .. ok All tests successful. Files=1, Tests=7, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.28 cusr 0.02 csys = 0.32 CPU) Result: PASS
Created attachment 20515 [details] [review] [SIGNED OFF] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests The test are wrap in a transaction. Note : The last test (in comment) currently doesn't pass because it needs some modifications of delete_report. To test: prove t/db_dependent/Reports_Guided.t t/db_dependent/Reports_Guided.t .. ok All tests successful. Files=1, Tests=7, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.28 cusr 0.02 csys = 0.32 CPU) Result: PASS Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works nicely, tested with patch for bug 10761 applied.
QA comment: I found some improvements for this routine, I will submit a qa followup. If the $sth->finish statement is removed (see bug 3134 comment 24), it is possible to know how many rows are affected by the DELETE query. Marked as Passed QA.
Created attachment 20530 [details] [review] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests The test are wrap in a transaction. Note : The last test (in comment) currently doesn't pass because it needs some modifications of delete_report. To test: prove t/db_dependent/Reports_Guided.t t/db_dependent/Reports_Guided.t .. ok All tests successful. Files=1, Tests=7, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.28 cusr 0.02 csys = 0.32 CPU) Result: PASS Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works nicely, tested with patch for bug 10761 applied. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 20531 [details] [review] Bug 10761: UT: Improvement for Reports_guided.t 1/ delete_report should return undef is no parameter is given. 2/ delete_report returns the number of affected rows. 3/ delete_report should be tested with 1 and more parameters. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master, along with a follow-up to explicitly return from C4::Reports::Guided::delete_report(). Thanks, Kenza and Jonathan!