Lines 245-254
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
Link Here
|
245 |
my ( $item ) = $bi[0]->items(); |
245 |
my ( $item ) = $bi[0]->items(); |
246 |
|
246 |
|
247 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); |
247 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); |
248 |
ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
248 |
is( $item->effective_itemtype(), 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
249 |
|
249 |
|
250 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); |
250 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); |
251 |
ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); |
251 |
is( $item->effective_itemtype(), 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); |
252 |
|
252 |
|
253 |
# If itemtype is not defined and item-level_level item types are set |
253 |
# If itemtype is not defined and item-level_level item types are set |
254 |
# fallback to biblio-level itemtype (Bug 14651) and warn |
254 |
# fallback to biblio-level itemtype (Bug 14651) and warn |
255 |
- |
|
|