|
Lines 6-12
use t::lib::Mocks;
Link Here
|
| 6 |
use C4::Context; |
6 |
use C4::Context; |
| 7 |
use C4::Branch; |
7 |
use C4::Branch; |
| 8 |
|
8 |
|
| 9 |
use Test::More tests => 23; |
9 |
use Test::More tests => 25; |
| 10 |
use MARC::Record; |
10 |
use MARC::Record; |
| 11 |
use C4::Biblio; |
11 |
use C4::Biblio; |
| 12 |
use C4::Items; |
12 |
use C4::Items; |
|
Lines 253-260
my $reserveid2 = C4::Reserves::GetReserveId(
Link Here
|
| 253 |
CancelReserve({ reserve_id => $reserveid1 }); |
253 |
CancelReserve({ reserve_id => $reserveid1 }); |
| 254 |
|
254 |
|
| 255 |
$reserve2 = GetReserve( $reserveid2 ); |
255 |
$reserve2 = GetReserve( $reserveid2 ); |
| 256 |
is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve become the first on the waiting list" ); |
256 |
is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve becomes the first on the waiting list" ); |
| 257 |
|
257 |
|
|
|
258 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); |
| 259 |
AddReserve( |
| 260 |
$branch, |
| 261 |
$borrowernumbers[0], |
| 262 |
$bibnum, |
| 263 |
'a', |
| 264 |
'', |
| 265 |
2, |
| 266 |
); |
| 267 |
my $reserveid3 = C4::Reserves::GetReserveId( |
| 268 |
{ |
| 269 |
biblionumber => $bibnum, |
| 270 |
borrowernumber => $borrowernumbers[0] |
| 271 |
} |
| 272 |
); |
| 273 |
|
| 274 |
my $reserve3 = GetReserve( $reserveid3 ); |
| 275 |
is( $reserve3->{priority}, 2, "New reserve for patron 0, the reserve has a priority = 2" ); |
| 276 |
|
| 277 |
ModReserve({ reserve_id => $reserveid2, rank => 'del' }); |
| 278 |
$reserve3 = GetReserve( $reserveid3 ); |
| 279 |
is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the first on the waiting list" ); |
| 258 |
|
280 |
|
| 259 |
|
281 |
|
| 260 |
# Helper method to set up a Biblio. |
282 |
# Helper method to set up a Biblio. |
| 261 |
- |
|
|