Bug 8768 - t/ItemType.t fails because DBD::Mock has no empty result set
Summary: t/ItemType.t fails because DBD::Mock has no empty result set
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Colin Campbell
QA Contact: Jonathan Druart
Depends on:
Reported: 2012-09-13 09:37 UTC by Colin Campbell
Modified: 2013-05-23 06:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:

Proposed patch (1.17 KB, patch)
2012-09-13 09:53 UTC, Colin Campbell
Details | Diff | Splinter Review
bug 8768 correct an error in ItemType.t (1.21 KB, patch)
2012-09-14 02:33 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Campbell 2012-09-13 09:37:09 UTC
ItemType.t fails because the second test attempts to retrieve a non existent result set causing an error in DBI
The intention of the test is that all returns 0 on an empty table so DBD::Mock should be populated with an empty result set otherwise the test suite fails
Comment 1 Colin Campbell 2012-09-13 09:53:02 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2012-09-14 02:32:23 UTC
Hmm I dont see the fail before the patch

 prove t/ItemType.t                        2012-09-14 14:28:40 chrisc pts/1
t/ItemType.t .. ok     
All tests successful.
Files=1, Tests=15,  1 wallclock secs ( 0.05 usr  0.01 sys +  0.12 cusr  0.03 csys =  0.21 CPU)
Result: PASS

And still all 15 pass afterwards.

But it is more correct to declare an empty set, so will sign off. (Note this was passing fine on jenkins too)
Comment 3 Chris Cormack 2012-09-14 02:33:00 UTC
Created attachment 12205 [details] [review]
bug 8768 correct an error in ItemType.t

The second test in ItemType.t tests that an empty table
returns no rows however as Mock::DBD has no resultset
it fails with an error in DBI It requires that an
empty resultset is defined in Mock::DBD first
This patch adds that mocked empty table

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 4 Jonathan Druart 2012-09-14 13:01:25 UTC
QA Comments:
The patch fixes a failed test. Marked as Passed QA.
Comment 5 Paul Poulain 2012-09-15 05:21:37 UTC
Patch pushed to master