Bug 10761

Summary: UT: saved_report and delete_report in C4::Reports::Report_Guided.pm need unit tests.
Product: Koha Reporter: kenza <kenza.zaki>
Component: Test SuiteAssignee: kenza <kenza.zaki>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart+koha>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart+koha, kenza.zaki
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 3134    
Bug Blocks:    
Attachments: Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests
Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests
[SIGNED OFF] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests
Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests
Bug 10761: UT: Improvement for Reports_guided.t

Description kenza 2013-08-19 13:29:32 UTC

    
Comment 1 kenza 2013-08-19 13:34:58 UTC Comment hidden (obsolete)
Comment 2 kenza 2013-08-19 14:27:32 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-08-20 21:42:22 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-08-21 09:07:30 UTC
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.
Comment 5 Jonathan Druart 2013-08-21 09:08:05 UTC
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>
Comment 6 Jonathan Druart 2013-08-21 09:08:09 UTC
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>
Comment 7 Galen Charlton 2013-08-21 14:49:13 UTC
Pushed to master, along with a follow-up to explicitly return from C4::Reports::Guided::delete_report().  Thanks, Kenza and Jonathan!