From 970af1b6abe0cc61374fc372c98365c6e04e6e94 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2015 14:43:15 +0100 Subject: [PATCH] Bug 7634: Make the tests pass This patch just fixed a master bug, if your database already has some items.homebranch set to CPL Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 704aed77ea03bf8a0a0e4ece457e91fb7937742d) Signed-off-by: Chris Cormack --- t/db_dependent/Items.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index b78e131426..06b7eac4b3 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -235,6 +235,8 @@ subtest 'SearchItems test' => sub { $dbh->{RaiseError} = 1; C4::Context->set_preference('marcflavour', 'MARC21'); + my $cpl_items_before = SearchItemsByField( 'homebranch', 'CPL'); + my ($biblionumber) = get_biblio(); # Add branches if they don't exist @@ -383,8 +385,8 @@ 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' ); + my $cpl_items_after = SearchItemsByField( 'homebranch', 'CPL'); + is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' ); $dbh->rollback; }; -- 2.39.5