|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 65; |
20 |
use Test::More tests => 66; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
|
23 |
|
|
Lines 1190-1195
subtest 'AllowHoldOnPatronPossession test' => sub {
Link Here
|
| 1190 |
'Patron can place hold on an item loaned to itself'); |
1190 |
'Patron can place hold on an item loaned to itself'); |
| 1191 |
}; |
1191 |
}; |
| 1192 |
|
1192 |
|
|
|
1193 |
subtest 'MergeHolds' => sub { |
| 1194 |
|
| 1195 |
plan tests => 1; |
| 1196 |
|
| 1197 |
my $biblio_1 = $builder->build_sample_biblio(); |
| 1198 |
my $biblio_2 = $builder->build_sample_biblio(); |
| 1199 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 1200 |
my $itype = $builder->build_object( |
| 1201 |
{ class => "Koha::ItemTypes", value => { notforloan => 0 } } ); |
| 1202 |
my $item_1 = $builder->build_sample_item( |
| 1203 |
{ |
| 1204 |
biblionumber => $biblio_1->biblionumber, |
| 1205 |
itype => $itype->itemtype, |
| 1206 |
library => $library->branchcode |
| 1207 |
} |
| 1208 |
); |
| 1209 |
my $patron_1 = $builder->build_object( { class => "Koha::Patrons" } ); |
| 1210 |
|
| 1211 |
# Place a hold on $biblio_1 |
| 1212 |
my $priority = 1; |
| 1213 |
place_item_hold( $patron_1, $item_1, $library, $priority ); |
| 1214 |
|
| 1215 |
# Move and make sure hold is now on $biblio_2 |
| 1216 |
C4::Reserves::MergeHolds($dbh, $biblio_2->biblionumber, $biblio_1->biblionumber); |
| 1217 |
is( $biblio_2->holds->count, 1, 'Hold has been transferred' ); |
| 1218 |
}; |
| 1219 |
|
| 1193 |
sub count_hold_print_messages { |
1220 |
sub count_hold_print_messages { |
| 1194 |
my $message_count = $dbh->selectall_arrayref(q{ |
1221 |
my $message_count = $dbh->selectall_arrayref(q{ |
| 1195 |
SELECT COUNT(*) |
1222 |
SELECT COUNT(*) |
| 1196 |
- |
|
|