|
Lines 228-248
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
Link Here
|
| 228 |
|
228 |
|
| 229 |
$schema->storage->txn_begin; |
229 |
$schema->storage->txn_begin; |
| 230 |
|
230 |
|
| 231 |
my $biblio = |
231 |
my $biblio = $schema->resultset('Biblio')->create({ |
| 232 |
$schema->resultset('Biblio')->create( |
232 |
title => "Test title", |
| 233 |
{ |
233 |
biblioitems => [ { itemtype => 'BIB_LEVEL' } ], |
| 234 |
title => "Test title", |
234 |
}); |
| 235 |
biblioitems => [ |
235 |
my $biblioitem = $biblio->biblioitems->first; |
| 236 |
{ |
236 |
my $item = $schema->resultset('Item')->create({ |
| 237 |
itemtype => 'BIB_LEVEL', |
237 |
biblioitemnumber => $biblioitem->biblioitemnumber, |
| 238 |
items => [ { itype => "ITEM_LEVEL" } ] |
238 |
biblionumber => $biblio->biblionumber, |
| 239 |
} |
239 |
itype => "ITEM_LEVEL", |
| 240 |
] |
240 |
}); |
| 241 |
} |
|
|
| 242 |
); |
| 243 |
|
| 244 |
my @bi = $biblio->biblioitems(); |
| 245 |
my ( $item ) = $bi[0]->items(); |
| 246 |
|
241 |
|
| 247 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); |
242 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); |
| 248 |
is( $item->effective_itemtype(), 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
243 |
is( $item->effective_itemtype(), 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
| 249 |
- |
|
|