From 8ca60397fa603d89018358651ef495346fb26b3c Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Mon, 13 Apr 2015 10:12:03 +0200
Subject: [PATCH] Bug 8684: Add regression tests for SearchItemsByField

---
 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;
 };
 
-- 
2.1.0