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
---
 t/ItemType.t | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/t/ItemType.t b/t/ItemType.t
index 476ca19..87e090e 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' );
-- 
1.7.12.363.g53284de

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to