@@ -, +, @@ --- t/db_dependent/Items.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -105,7 +105,7 @@ subtest 'General Add, Get and Del tests' => sub { subtest 'GetHiddenItemnumbers tests' => sub { - plan tests => 9; + plan tests => 11; # This sub is controlled by the OpacHiddenItems system preference. @@ -190,6 +190,13 @@ subtest 'GetHiddenItemnumbers tests' => sub { ok( scalar @hidden == 2, "Two items hidden"); is_deeply( \@hidden, \@itemnumbers, "withdrawn=1 and homebranch library2 hidden"); + # Override hidden with patron category + t::lib::Mocks::mock_preference( 'OpacHiddenItemsExceptions', 'S' ); + @hidden = GetHiddenItemnumbers( { items => \@items, borcat => 'PT' } ); + ok( scalar @hidden == 2, "Two items still hidden"); + @hidden = GetHiddenItemnumbers( { items => \@items, borcat => 'S' } ); + ok( scalar @hidden == 0, "Two items not hidden"); + # Valid OpacHiddenItems, empty list @items = (); @hidden = GetHiddenItemnumbers( { items => \@items } ); --