|
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 => 84; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
|
23 |
|
|
Lines 131-136
is($status, "Reserved", "CheckReserves Test 2");
Link Here
|
| 131 |
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode); |
131 |
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode); |
| 132 |
is($status, "Reserved", "CheckReserves Test 3"); |
132 |
is($status, "Reserved", "CheckReserves Test 3"); |
| 133 |
|
133 |
|
|
|
134 |
# Set the preference 'IndependentBranchesTransfers' is set to 'yes' |
| 135 |
# the userenv branch and the branche code are not the same holds should be filtered |
| 136 |
t::lib::Mocks::mock_preference( 'IndependentBranchesTransfers', 1 ); |
| 137 |
($status) = CheckReserves($item->itemnumber, $barcode); |
| 138 |
is( $status, "", 'Reserves is filtered'); |
| 139 |
($status, $reserve, $all_reserves) = CheckReserves($item->itemnumber); |
| 140 |
is( $status, "", 'Reserves is filtered'); |
| 141 |
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode); |
| 142 |
is( $status, "", 'Reserves is filtered'); |
| 143 |
|
| 144 |
# Set the userenv branchcode to be the same to the item branchcode. |
| 145 |
t::lib::Mocks::mock_userenv({ branchcode => $branchcode }); |
| 146 |
($status) = CheckReserves($item->itemnumber, $barcode); |
| 147 |
is( $status, "Reserved", 'Reserves should not be filtered'); |
| 148 |
($status, $reserve, $all_reserves) = CheckReserves($item->itemnumber); |
| 149 |
is( $status, "Reserved", 'Reserves should not be filtered'); |
| 150 |
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode); |
| 151 |
is( $status, "Reserved", 'Reserves should not be filtered'); |
| 152 |
|
| 153 |
t::lib::Mocks::mock_userenv({ branchcode => $branch_1 }); |
| 154 |
t::lib::Mocks::mock_preference( 'IndependentBranchesTransfers', 0 ); |
| 134 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
155 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
| 135 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
156 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
| 136 |
ok( |
157 |
ok( |
| 137 |
- |
|
|