Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 6; |
22 |
use Test::More tests => 7; |
23 |
|
23 |
|
24 |
use C4::Biblio; |
24 |
use C4::Biblio; |
25 |
use C4::Circulation; |
25 |
use C4::Circulation; |
Lines 500-503
subtest 'renewal_branchcode' => sub {
Link Here
|
500 |
is( $item->renewal_branchcode, $item->homebranch, "If interface opac and OpacRenewalBranch set to itemhomebranch, we get homebranch of item"); |
500 |
is( $item->renewal_branchcode, $item->homebranch, "If interface opac and OpacRenewalBranch set to itemhomebranch, we get homebranch of item"); |
501 |
is( $item->renewal_branchcode({branch=>'MANATEE'}), $item->homebranch, "If interface opac and OpacRenewalBranch set to itemhomebranch, we get homebranch of item even if branch passed"); |
501 |
is( $item->renewal_branchcode({branch=>'MANATEE'}), $item->homebranch, "If interface opac and OpacRenewalBranch set to itemhomebranch, we get homebranch of item even if branch passed"); |
502 |
|
502 |
|
|
|
503 |
$schema->storage->txn_rollback; |
504 |
}; |
505 |
|
506 |
subtest 'Tests for itemtype' => sub { |
507 |
plan tests => 4; |
508 |
$schema->storage->txn_begin; |
509 |
|
510 |
my $biblio = $builder->build_sample_biblio; |
511 |
my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); |
512 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, itype => $itemtype->itemtype }); |
513 |
|
514 |
t::lib::Mocks::mock_preference('item-level_itypes', 1); |
515 |
is( $item->itemtype({ effective => 1 })->itemtype, $item->itype, 'Pref enabled, effective parameter' ); |
516 |
is( $item->itemtype->itemtype, $item->itype, 'Pref enabled, no parameter' ); |
517 |
t::lib::Mocks::mock_preference('item-level_itypes', 0); |
518 |
is( $item->itemtype({ effective => 1 })->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled, effective parameter' ); |
519 |
is( $item->itemtype->itemtype, $item->itype, 'Pref disabled, no parameter' ); |
520 |
|
521 |
$schema->storage->txn_rollback; |
503 |
}; |
522 |
}; |
504 |
- |
|
|