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>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Colin Campbell 2012-09-13 10:37:56 +01:00 committed by Paul Poulain
parent b592d340af
commit bf79b889f0

View file

@ -1,6 +1,5 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# This Koha test module is a stub!
# Add more tests here!!! # Add more tests here!!!
use strict; use strict;
@ -33,7 +32,15 @@ my $itemtypes = [
[ 'CD', 'CDRom', 0, 0, '', '' ] [ 'CD', 'CDRom', 0, 0, '', '' ]
]; ];
my $itemtypes_empty = [
[
'itemtype', 'description', 'rentalcharge', 'notforloan',
'imageurl', 'summary'
],
];
my $dbh = C4::Context->dbh(); my $dbh = C4::Context->dbh();
$dbh->{mock_add_resultset} = $itemtypes_empty;
my @itemtypes = C4::ItemType->all(); my @itemtypes = C4::ItemType->all();
is( @itemtypes, 0, 'Testing all itemtypes is empty' ); is( @itemtypes, 0, 'Testing all itemtypes is empty' );