From 7c8c3f8616558966ff5f21206cd2b9b6911ce20c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 13 Apr 2015 10:12:03 +0200 Subject: [PATCH 2/2] Bug 8684: Add regression tests for SearchItemsByField Signed-off-by: Amit Gupta --- t/db_dependent/Items.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index b41b483..b78e131 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -228,7 +228,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { }; subtest 'SearchItems test' => sub { - plan tests => 13; + plan tests => 14; # Start transaction $dbh->{AutoCommit} = 0; @@ -383,6 +383,9 @@ subtest 'SearchItems test' => sub { ($items, $total_results) = SearchItems($filter); ok(scalar @$items == 1, 'found 1 item with itemnotes = "foobar"'); + my $cpl_items = SearchItemsByField( 'homebranch', 'CPL'); + is( ( $cpl_items and scalar( @$cpl_items ) ), 1, 'SearchItemsByField should return something' ); + $dbh->rollback; }; -- 1.7.9.5