Lines 195-201
subtest 'GetItemsInfo tests' => sub {
Link Here
|
195 |
|
195 |
|
196 |
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { |
196 |
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { |
197 |
|
197 |
|
198 |
plan tests => 2; |
198 |
plan tests => 3; |
199 |
|
199 |
|
200 |
# Start transaction |
200 |
# Start transaction |
201 |
$dbh->{AutoCommit} = 0; |
201 |
$dbh->{AutoCommit} = 0; |
Lines 225-230
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
Link Here
|
225 |
C4::Context->set_preference( 'item-level_itypes', 1 ); |
225 |
C4::Context->set_preference( 'item-level_itypes', 1 ); |
226 |
ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); |
226 |
ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); |
227 |
|
227 |
|
|
|
228 |
# If itemtype is not defined and item-level_level item types are set |
229 |
# fallback to biblio-level itemtype (Bug 14651) |
230 |
$item->itype( undef ); |
231 |
$item->update(); |
232 |
ok( defined $item->effective_itemtype() && |
233 |
$item->effective_itemtype() eq 'BIB_LEVEL', |
234 |
'$item->effective_itemtype() falls back to biblioitems.itemtype when item-level_itypes is enabled but undef' ); |
235 |
|
228 |
$dbh->rollback; |
236 |
$dbh->rollback; |
229 |
}; |
237 |
}; |
230 |
|
238 |
|
231 |
- |
|
|