Bug 8768

Summary: t/ItemType.t fails because DBD::Mock has no empty result set
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: Test SuiteAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: chris, jonathan.druart, paul.poulain
Version: 3.10   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
bug 8768 correct an error in ItemType.t

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