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