|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 62; |
20 |
use Test::More tests => 63; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Warn; |
22 |
use Test::Warn; |
| 23 |
|
23 |
|
|
Lines 875-880
subtest 'MoveReserve additional test' => sub {
Link Here
|
| 875 |
|
875 |
|
| 876 |
}; |
876 |
}; |
| 877 |
|
877 |
|
|
|
878 |
subtest 'RevertWaitingStatus' => sub { |
| 879 |
|
| 880 |
plan tests => 2; |
| 881 |
|
| 882 |
# Create the items and patrons we need |
| 883 |
my $biblio = $builder->build_sample_biblio(); |
| 884 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 885 |
my $itype = $builder->build_object( |
| 886 |
{ class => "Koha::ItemTypes", value => { notforloan => 0 } } ); |
| 887 |
my $item_1 = $builder->build_sample_item( |
| 888 |
{ |
| 889 |
biblionumber => $biblio->biblionumber, |
| 890 |
itype => $itype->itemtype, |
| 891 |
library => $library->branchcode |
| 892 |
} |
| 893 |
); |
| 894 |
my $patron_1 = $builder->build_object( { class => "Koha::Patrons" } ); |
| 895 |
my $patron_2 = $builder->build_object( { class => "Koha::Patrons" } ); |
| 896 |
my $patron_3 = $builder->build_object( { class => "Koha::Patrons" } ); |
| 897 |
my $patron_4 = $builder->build_object( { class => "Koha::Patrons" } ); |
| 898 |
|
| 899 |
# Place a hold on the title for both patrons |
| 900 |
my $hold_1 = place_item_hold( $patron_1, $item_1, $library, $priority ); |
| 901 |
my $hold_2 = place_item_hold( $patron_2, $item_1, $library, $priority ); |
| 902 |
my $hold_3 = place_item_hold( $patron_3, $item_1, $library, $priority ); |
| 903 |
my $hold_4 = place_item_hold( $patron_4, $item_1, $library, $priority ); |
| 904 |
|
| 905 |
$hold_1->set_waiting; |
| 906 |
AddIssue( $patron_3->unblessed, $item_1->barcode, undef, 'revert' ); |
| 907 |
|
| 908 |
my $holds = $biblio->holds; |
| 909 |
is( $holds->count, 3, 'One hold has been deleted' ); |
| 910 |
is_deeply( |
| 911 |
[ |
| 912 |
$holds->next->priority, $holds->next->priority, |
| 913 |
$holds->next->priority |
| 914 |
], |
| 915 |
[ 1, 2, 3 ], |
| 916 |
'priorities have been reordered' |
| 917 |
); |
| 918 |
}; |
| 919 |
|
| 878 |
sub count_hold_print_messages { |
920 |
sub count_hold_print_messages { |
| 879 |
my $message_count = $dbh->selectall_arrayref(q{ |
921 |
my $message_count = $dbh->selectall_arrayref(q{ |
| 880 |
SELECT COUNT(*) |
922 |
SELECT COUNT(*) |
| 881 |
- |
|
|