Lines 504-510
subtest 'renewal_branchcode' => sub {
Link Here
|
504 |
}; |
504 |
}; |
505 |
|
505 |
|
506 |
subtest 'Tests for itemtype' => sub { |
506 |
subtest 'Tests for itemtype' => sub { |
507 |
plan tests => 4; |
507 |
plan tests => 2; |
508 |
$schema->storage->txn_begin; |
508 |
$schema->storage->txn_begin; |
509 |
|
509 |
|
510 |
my $biblio = $builder->build_sample_biblio; |
510 |
my $biblio = $builder->build_sample_biblio; |
Lines 512-522
subtest 'Tests for itemtype' => sub {
Link Here
|
512 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, itype => $itemtype->itemtype }); |
512 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, itype => $itemtype->itemtype }); |
513 |
|
513 |
|
514 |
t::lib::Mocks::mock_preference('item-level_itypes', 1); |
514 |
t::lib::Mocks::mock_preference('item-level_itypes', 1); |
515 |
is( $item->itemtype({ effective => 1 })->itemtype, $item->itype, 'Pref enabled, effective parameter' ); |
515 |
is( $item->itemtype->itemtype, $item->itype, 'Pref enabled' ); |
516 |
is( $item->itemtype->itemtype, $item->itype, 'Pref enabled, no parameter' ); |
|
|
517 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
516 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
518 |
is( $item->itemtype({ effective => 1 })->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled, effective parameter' ); |
517 |
is( $item->itemtype->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled' ); |
519 |
is( $item->itemtype->itemtype, $item->itype, 'Pref disabled, no parameter' ); |
|
|
520 |
|
518 |
|
521 |
$schema->storage->txn_rollback; |
519 |
$schema->storage->txn_rollback; |
522 |
}; |
520 |
}; |
523 |
- |
|
|