|
Lines 20-26
Link Here
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
use utf8; |
21 |
use utf8; |
| 22 |
|
22 |
|
| 23 |
use Test::More tests => 36; |
23 |
use Test::More tests => 35; |
| 24 |
use Test::Exception; |
24 |
use Test::Exception; |
| 25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
| 26 |
|
26 |
|
|
Lines 2747-2753
subtest 'check_booking tests' => sub {
Link Here
|
| 2747 |
$schema->storage->txn_rollback; |
2747 |
$schema->storage->txn_rollback; |
| 2748 |
}; |
2748 |
}; |
| 2749 |
|
2749 |
|
| 2750 |
subtest 'not_for_loan() tests' => sub { |
2750 |
subtest 'effective_not_for_loan_status() tests' => sub { |
| 2751 |
|
2751 |
|
| 2752 |
plan tests => 5; |
2752 |
plan tests => 5; |
| 2753 |
|
2753 |
|
|
Lines 2769-2782
subtest 'not_for_loan() tests' => sub {
Link Here
|
| 2769 |
note("item-level_itypes: 0"); |
2769 |
note("item-level_itypes: 0"); |
| 2770 |
|
2770 |
|
| 2771 |
is( |
2771 |
is( |
| 2772 |
$item->not_for_loan, $item->notforloan, |
2772 |
$item->effective_not_for_loan_status, $item->notforloan, |
| 2773 |
'->not_for_loan returns item specific notforloan value when defined and non-zero' |
2773 |
'->effective_not_for_loan_status returns item specific notforloan value when defined and non-zero' |
| 2774 |
); |
2774 |
); |
| 2775 |
|
2775 |
|
| 2776 |
$item->notforloan(0)->store(); |
2776 |
$item->notforloan(0)->store(); |
| 2777 |
is( |
2777 |
is( |
| 2778 |
$item->not_for_loan, $biblio_itype->notforloan, |
2778 |
$item->effective_not_for_loan_status, $biblio_itype->notforloan, |
| 2779 |
'->not_for_loan returns biblio level itype notforloan value when item notforloan is 0' |
2779 |
'->effective_not_for_loan_status returns biblio level itype notforloan value when item notforloan is 0' |
| 2780 |
); |
2780 |
); |
| 2781 |
|
2781 |
|
| 2782 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); |
2782 |
t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); |
|
Lines 2784-2797
subtest 'not_for_loan() tests' => sub {
Link Here
|
| 2784 |
|
2784 |
|
| 2785 |
$item->notforloan(1)->store(); |
2785 |
$item->notforloan(1)->store(); |
| 2786 |
is( |
2786 |
is( |
| 2787 |
$item->not_for_loan, $item->notforloan, |
2787 |
$item->effective_not_for_loan_status, $item->notforloan, |
| 2788 |
'->not_for_loan returns item specific notforloan value when defined and non-zero' |
2788 |
'->effective_not_for_loan_status returns item specific notforloan value when defined and non-zero' |
| 2789 |
); |
2789 |
); |
| 2790 |
|
2790 |
|
| 2791 |
$item->notforloan(0)->store(); |
2791 |
$item->notforloan(0)->store(); |
| 2792 |
is( |
2792 |
is( |
| 2793 |
$item->not_for_loan, $item_itype->notforloan, |
2793 |
$item->effective_not_for_loan_status, $item_itype->notforloan, |
| 2794 |
'->not_for_loan returns biblio level itype notforloan value when item notforloan is 0' |
2794 |
'->effective_not_for_loan_status returns biblio level itype notforloan value when item notforloan is 0' |
| 2795 |
); |
2795 |
); |
| 2796 |
|
2796 |
|
| 2797 |
$schema->storage->txn_rollback; |
2797 |
$schema->storage->txn_rollback; |
| 2798 |
- |
|
|