@@ -, +, @@ --- t/db_dependent/Items.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -155,12 +155,12 @@ subtest 'GetHiddenItemnumbers tests' => sub { push @items, GetItem( $item2_itemnumber ); # Empty OpacHiddenItems - C4::Context->set_preference('OpacHiddenItems',''); + t::lib::Mocks::mock_preference('OpacHiddenItems',''); ok( !defined( GetHiddenItemnumbers( { items => \@items } ) ), "Hidden items list undef if OpacHiddenItems empty"); # Blank spaces - C4::Context->set_preference('OpacHiddenItems',' '); + t::lib::Mocks::mock_preference('OpacHiddenItems',' '); ok( scalar GetHiddenItemnumbers( { items => \@items } ) == 0, "Hidden items list empty if OpacHiddenItems only contains blanks"); @@ -176,7 +176,6 @@ subtest 'GetHiddenItemnumbers tests' => sub { $opachiddenitems = " withdrawn: [1,0]"; t::lib::Mocks::mock_preference( 'OpacHiddenItems', $opachiddenitems ); - C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems ); @hidden = GetHiddenItemnumbers( { items => \@items } ); ok( scalar @hidden == 2, "Two items hidden"); is_deeply( \@hidden, \@itemnumbers, "withdrawn=1 and withdrawn=0 hidden"); --