|
Lines 291-297
subtest 'LookupPatron test' => sub {
Link Here
|
| 291 |
|
291 |
|
| 292 |
subtest 'Holds test' => sub { |
292 |
subtest 'Holds test' => sub { |
| 293 |
|
293 |
|
| 294 |
plan tests => 3; |
294 |
plan tests => 4; |
| 295 |
|
295 |
|
| 296 |
$schema->storage->txn_begin; |
296 |
$schema->storage->txn_begin; |
| 297 |
|
297 |
|
|
Lines 380-384
subtest 'Holds test' => sub {
Link Here
|
| 380 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
380 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
| 381 |
is( $reply->{code}, 'tooManyReserves', "Too many reserves" ); |
381 |
is( $reply->{code}, 'tooManyReserves', "Too many reserves" ); |
| 382 |
|
382 |
|
|
|
383 |
my $biblio3 = $builder->build({ |
| 384 |
source => 'Biblio', |
| 385 |
}); |
| 386 |
|
| 387 |
my $biblioitems3 = $builder->build({ |
| 388 |
source => 'Biblioitem', |
| 389 |
value => { |
| 390 |
biblionumber => $biblio3->{biblionumber}, |
| 391 |
} |
| 392 |
}); |
| 393 |
|
| 394 |
# Adding a holdable item to biblio 3. |
| 395 |
my $item3 = $builder->build({ |
| 396 |
source => 'Item', |
| 397 |
value => { |
| 398 |
biblionumber => $biblio3->{biblionumber}, |
| 399 |
damaged => 0, |
| 400 |
} |
| 401 |
}); |
| 402 |
|
| 403 |
my $item4 = $builder->build({ |
| 404 |
source => 'Item', |
| 405 |
value => { |
| 406 |
biblionumber => $biblio3->{biblionumber}, |
| 407 |
damaged => 1, |
| 408 |
} |
| 409 |
}); |
| 410 |
|
| 411 |
my $issuingrule2 = $builder->build({ |
| 412 |
source => 'Issuingrule', |
| 413 |
value => { |
| 414 |
categorycode => $patron->{categorycode}, |
| 415 |
itemtype => $item3->{itype}, |
| 416 |
branchcode => $patron->{branchcode}, |
| 417 |
reservesallowed => 10, |
| 418 |
} |
| 419 |
}); |
| 420 |
|
| 421 |
$query = new CGI; |
| 422 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 423 |
$query->param( 'bib_id', $biblio3->{biblionumber}); |
| 424 |
$query->param( 'item_id', $item4->{itemnumber}); |
| 425 |
|
| 426 |
$reply = C4::ILSDI::Services::HoldItem( $query ); |
| 427 |
is( $reply->{code}, 'damaged', "Item is damaged" ); |
| 428 |
|
| 383 |
$schema->storage->txn_rollback; |
429 |
$schema->storage->txn_rollback; |
| 384 |
}; |
430 |
}; |
| 385 |
- |
|
|