Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 78; |
20 |
use Test::More tests => 80; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
|
23 |
|
Lines 62-67
my $frameworkcode = q//;
Link Here
|
62 |
|
62 |
|
63 |
|
63 |
|
64 |
t::lib::Mocks::mock_preference('ReservesNeedReturns', 1); |
64 |
t::lib::Mocks::mock_preference('ReservesNeedReturns', 1); |
|
|
65 |
t::lib::Mocks::mock_preference( 'IndependentBranchesTransfers', 0 ); |
65 |
|
66 |
|
66 |
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached |
67 |
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached |
67 |
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a' and frameworkcode=?", undef, $frameworkcode); |
68 |
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a' and frameworkcode=?", undef, $frameworkcode); |
Lines 129-134
ok(exists($reserve->{reserve_id}), 'CheckReserves() include reserve_id in its re
Link Here
|
129 |
($status, $reserve, $all_reserves) = CheckReserves( $item ); |
130 |
($status, $reserve, $all_reserves) = CheckReserves( $item ); |
130 |
is($status, "Reserved", "CheckReserves Test 2"); |
131 |
is($status, "Reserved", "CheckReserves Test 2"); |
131 |
|
132 |
|
|
|
133 |
# Set the preference 'IndependentBranchesTransfers' is set to 'yes' |
134 |
# the userenv branch and the branche code are not the same holds should be filtered |
135 |
t::lib::Mocks::mock_preference( 'IndependentBranchesTransfers', 1 ); |
136 |
($status, $reserve, $all_reserves) = CheckReserves( $item ); |
137 |
is( $status, "", 'Reserves is filtered'); |
138 |
|
139 |
# Set the userenv branchcode to be the same to the item branchcode. |
140 |
t::lib::Mocks::mock_userenv({ branchcode => $branchcode }); |
141 |
($status, $reserve, $all_reserves) = CheckReserves( $item ); |
142 |
is( $status, "Reserved", 'Reserves should not be filtered'); |
143 |
|
144 |
t::lib::Mocks::mock_userenv({ branchcode => $branch_1 }); |
145 |
t::lib::Mocks::mock_preference( 'IndependentBranchesTransfers', 0 ); |
132 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
146 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
133 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
147 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
134 |
ok( |
148 |
ok( |
135 |
- |
|
|