|
Lines 22-28
use MARC::Record;
Link Here
|
| 22 |
use C4::Biblio; |
22 |
use C4::Biblio; |
| 23 |
use Koha::Database; |
23 |
use Koha::Database; |
| 24 |
|
24 |
|
| 25 |
use Test::More tests => 3; |
25 |
use Test::More tests => 4; |
| 26 |
|
26 |
|
| 27 |
BEGIN { |
27 |
BEGIN { |
| 28 |
use_ok('C4::Items'); |
28 |
use_ok('C4::Items'); |
|
Lines 169-178
subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
Link Here
|
| 169 |
my $biblioitem = $biblio->biblioitem(); |
169 |
my $biblioitem = $biblio->biblioitem(); |
| 170 |
my ( $item ) = $biblioitem->items(); |
170 |
my ( $item ) = $biblioitem->items(); |
| 171 |
|
171 |
|
| 172 |
C4::Context->set_preference( 'item-level_itypes', 0 ); |
172 |
$schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 0 }); |
| 173 |
ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
173 |
ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); |
| 174 |
|
174 |
|
| 175 |
C4::Context->set_preference( 'item-level_itypes', 1 ); |
175 |
$schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 1 }); |
| 176 |
ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); |
176 |
ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); |
| 177 |
|
177 |
|
| 178 |
|
178 |
|
| 179 |
- |
|
|