Lines 289-295
subtest 'filter_by_visible_in_opac() tests' => sub {
Link Here
|
289 |
my $item_5 = $builder->build_sample_item( |
289 |
my $item_5 = $builder->build_sample_item( |
290 |
{ |
290 |
{ |
291 |
biblionumber => $biblio->biblionumber, |
291 |
biblionumber => $biblio->biblionumber, |
292 |
itemlost => undef, |
292 |
itemlost => 0, |
|
|
293 |
itype => $itype_1->itemtype, |
294 |
withdrawn => 5 |
295 |
} |
296 |
); |
297 |
my $item_6 = $builder->build_sample_item( |
298 |
{ |
299 |
biblionumber => $biblio->biblionumber, |
300 |
itemlost => 2, |
293 |
itype => $itype_1->itemtype, |
301 |
itype => $itype_1->itemtype, |
294 |
withdrawn => 5 |
302 |
withdrawn => 5 |
295 |
} |
303 |
} |
Lines 299-310
subtest 'filter_by_visible_in_opac() tests' => sub {
Link Here
|
299 |
|
307 |
|
300 |
t::lib::Mocks::mock_preference( 'hidelostitems', 0 ); |
308 |
t::lib::Mocks::mock_preference( 'hidelostitems', 0 ); |
301 |
is( $biblio->items->filter_by_visible_in_opac->count, |
309 |
is( $biblio->items->filter_by_visible_in_opac->count, |
302 |
5, 'No rules passed, hidelostitems unset' ); |
310 |
6, 'No rules passed, hidelostitems unset' ); |
303 |
|
311 |
|
304 |
t::lib::Mocks::mock_preference( 'hidelostitems', 1 ); |
312 |
t::lib::Mocks::mock_preference( 'hidelostitems', 1 ); |
305 |
is( |
313 |
is( |
306 |
$biblio->items->filter_by_visible_in_opac( { rules => $rules } )->count, |
314 |
$biblio->items->filter_by_visible_in_opac( { rules => $rules } )->count, |
307 |
4, |
315 |
3, |
308 |
'No rules passed, hidelostitems set' |
316 |
'No rules passed, hidelostitems set' |
309 |
); |
317 |
); |
310 |
|
318 |
|
311 |
- |
|
|