Lines 1366-1372
subtest 'filter_by_visible_in_opac() tests' => sub {
Link Here
|
1366 |
my $item_5 = $builder->build_sample_item( |
1366 |
my $item_5 = $builder->build_sample_item( |
1367 |
{ |
1367 |
{ |
1368 |
biblionumber => $biblio->biblionumber, |
1368 |
biblionumber => $biblio->biblionumber, |
1369 |
itemlost => undef, |
1369 |
itemlost => 0, |
|
|
1370 |
itype => $itype_1->itemtype, |
1371 |
withdrawn => 5 |
1372 |
} |
1373 |
); |
1374 |
my $item_6 = $builder->build_sample_item( |
1375 |
{ |
1376 |
biblionumber => $biblio->biblionumber, |
1377 |
itemlost => 2, |
1370 |
itype => $itype_1->itemtype, |
1378 |
itype => $itype_1->itemtype, |
1371 |
withdrawn => 5 |
1379 |
withdrawn => 5 |
1372 |
} |
1380 |
} |
Lines 1376-1387
subtest 'filter_by_visible_in_opac() tests' => sub {
Link Here
|
1376 |
|
1384 |
|
1377 |
t::lib::Mocks::mock_preference( 'hidelostitems', 0 ); |
1385 |
t::lib::Mocks::mock_preference( 'hidelostitems', 0 ); |
1378 |
is( $biblio->items->filter_by_visible_in_opac->count, |
1386 |
is( $biblio->items->filter_by_visible_in_opac->count, |
1379 |
5, 'No rules passed, hidelostitems unset' ); |
1387 |
6, 'No rules passed, hidelostitems unset' ); |
1380 |
|
1388 |
|
1381 |
t::lib::Mocks::mock_preference( 'hidelostitems', 1 ); |
1389 |
t::lib::Mocks::mock_preference( 'hidelostitems', 1 ); |
1382 |
is( |
1390 |
is( |
1383 |
$biblio->items->filter_by_visible_in_opac( { rules => $rules } )->count, |
1391 |
$biblio->items->filter_by_visible_in_opac( { rules => $rules } )->count, |
1384 |
4, |
1392 |
3, |
1385 |
'No rules passed, hidelostitems set' |
1393 |
'No rules passed, hidelostitems set' |
1386 |
); |
1394 |
); |
1387 |
|
1395 |
|
1388 |
- |
|
|