From: Colin Campbell Date: Thu, 13 Sep 2012 09:37:56 +0000 (+0100) Subject: bug 8768 correct an error in ItemType.t X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=bf79b889f05937d5039c3246913c46c99ea3c928 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 Signed-off-by: Paul Poulain --- diff --git a/t/ItemType.t b/t/ItemType.t index 476ca198e1..87e090e2c6 100755 --- a/t/ItemType.t +++ b/t/ItemType.t @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# This Koha test module is a stub! # Add more tests here!!! use strict; @@ -33,7 +32,15 @@ my $itemtypes = [ [ 'CD', 'CDRom', 0, 0, '', '' ] ]; +my $itemtypes_empty = [ + [ + 'itemtype', 'description', 'rentalcharge', 'notforloan', + 'imageurl', 'summary' + ], +]; + my $dbh = C4::Context->dbh(); +$dbh->{mock_add_resultset} = $itemtypes_empty; my @itemtypes = C4::ItemType->all(); is( @itemtypes, 0, 'Testing all itemtypes is empty' );