|
Lines 548-554
subtest 'Holds test with start_date and end_date' => sub {
Link Here
|
| 548 |
|
548 |
|
| 549 |
subtest 'GetRecords' => sub { |
549 |
subtest 'GetRecords' => sub { |
| 550 |
|
550 |
|
| 551 |
plan tests => 1; |
551 |
plan tests => 8; |
| 552 |
|
552 |
|
| 553 |
$schema->storage->txn_begin; |
553 |
$schema->storage->txn_begin; |
| 554 |
|
554 |
|
|
Lines 567-572
subtest 'GetRecords' => sub {
Link Here
|
| 567 |
} |
567 |
} |
| 568 |
); |
568 |
); |
| 569 |
|
569 |
|
|
|
570 |
my $patron = $builder->build({ |
| 571 |
source => 'Borrower', |
| 572 |
}); |
| 573 |
|
| 574 |
my $issue = $builder->build({ |
| 575 |
source => 'Issue', |
| 576 |
value => { |
| 577 |
itemnumber => $item->itemnumber, |
| 578 |
} |
| 579 |
}); |
| 580 |
|
| 581 |
my $hold = $builder->build({ |
| 582 |
source => 'Reserve', |
| 583 |
value => { |
| 584 |
biblionumber => $item->biblionumber, |
| 585 |
} |
| 586 |
}); |
| 587 |
|
| 570 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
588 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
| 571 |
|
589 |
|
| 572 |
my $cgi = new CGI; |
590 |
my $cgi = new CGI; |
|
Lines 584-589
subtest 'GetRecords' => sub {
Link Here
|
| 584 |
is_deeply($reply->{record}->[0]->{items}->{item}->[0]->{transfer}, $expected, |
602 |
is_deeply($reply->{record}->[0]->{items}->{item}->[0]->{transfer}, $expected, |
| 585 |
'GetRecords returns transfer informations'); |
603 |
'GetRecords returns transfer informations'); |
| 586 |
|
604 |
|
|
|
605 |
# Check informations exposed |
| 606 |
my $reply_issue = $reply->{record}->[0]->{issues}->{issue}->[0]; |
| 607 |
is($reply_issue->{itemnumber}, $item->itemnumber, 'GetRecords has an issue tag'); |
| 608 |
is($reply_issue->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in issue tag'); |
| 609 |
is($reply_issue->{surname}, undef, 'GetRecords does not expose surname in issue tag'); |
| 610 |
is($reply_issue->{firstname}, undef, 'GetRecords does not expose firstname in issue tag'); |
| 611 |
is($reply_issue->{cardnumber}, undef, 'GetRecords does not expose cardnumber in issue tag'); |
| 612 |
my $reply_reserve = $reply->{record}->[0]->{reserves}->{reserve}->[0]; |
| 613 |
is($reply_reserve->{biblionumber}, $item->biblionumber, 'GetRecords has a reserve tag'); |
| 614 |
is($reply_reserve->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in reserve tag'); |
| 615 |
|
| 587 |
$schema->storage->txn_rollback; |
616 |
$schema->storage->txn_rollback; |
| 588 |
}; |
617 |
}; |
| 589 |
|
618 |
|
| 590 |
- |
|
|