subtest 'Holds test for branch transfer limits' => sub {
- plan tests => 4;
+ plan tests => 6;
$schema->storage->txn_begin;
$reply = C4::ILSDI::Services::HoldItem( $query );
is( $reply->{code}, undef, "Item hold, Item can be transferred" );
+ my $hold = Koha::Holds->search({ itemnumber => $item->{itemnumber}, borrowernumber => $patron->{borrowernumber} })->next;
+ is( $hold->branchcode, $pickup_branch->{branchcode}, 'The library id is correctly set' );
Koha::Holds->search()->delete();
$reply = C4::ILSDI::Services::HoldTitle( $query );
is( $reply->{code}, undef, "Record hold, Item con be transferred" );
+ $hold = Koha::Holds->search({ biblionumber => $biblio->{biblionumber}, borrowernumber => $patron->{borrowernumber} })->next;
+ is( $hold->branchcode, $pickup_branch->{branchcode}, 'The library id is correctly set' );
$schema->storage->txn_rollback;
};
};
subtest do_hold => sub {
- plan tests => 7;
+ plan tests => 8;
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my $patron_1 = $builder->build_object(
my $hold = $transaction->do_hold();
is( $item->biblio->holds->count(), 2, "Bib has 2 holds" );
- is( $patron_2->holds->next->priority, 2, 'Hold placed from SIP should have a correct priority of 2');
+ my $THE_hold = $patron_2->holds->next;
+ is( $THE_hold->priority, 2, 'Hold placed from SIP should have a correct priority of 2');
+ is( $THE_hold->branchcode, $patron_2->branchcode, 'Hold placed from SIP should have the branchcode set' );
};
subtest do_checkin => sub {