Bug 8684: Add regression tests for SearchItemsByField
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 13 Apr 2015 08:12:03 +0000 (10:12 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 24 Jul 2015 16:40:43 +0000 (13:40 -0300)
Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Items.t

index b41b483..b78e131 100755 (executable)
@@ -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;
 };