Bug 10761 - UT: saved_report and delete_report in C4::Reports::Report_Guided.pm need unit tests.
Summary: UT: saved_report and delete_report in C4::Reports::Report_Guided.pm need unit...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: kenza
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 3134
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-19 13:29 UTC by kenza
Modified: 2014-12-07 20:02 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests (2.77 KB, patch)
2013-08-19 13:34 UTC, kenza
Details | Diff | Splinter Review
Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests (3.04 KB, patch)
2013-08-19 14:27 UTC, kenza
Details | Diff | Splinter Review
[SIGNED OFF] Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests (3.17 KB, patch)
2013-08-20 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10761:UT:save_report and delete_report in C4::Reports::Report_Guided.pm need unit tests (3.22 KB, patch)
2013-08-21 09:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10761: UT: Improvement for Reports_guided.t (4.08 KB, patch)
2013-08-21 09:08 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!