View | Details | Raw Unified | Return to bug 23070
Collapse All | Expand All

(-)a/t/db_dependent/Reserves.t (-2 / +44 lines)
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 1035-1040 subtest 'MoveReserve additional test' => sub { Link Here
1035
1035
1036
};
1036
};
1037
1037
1038
subtest 'RevertWaitingStatus' => sub {
1039
1040
    plan tests => 2;
1041
1042
    # Create the items and patrons we need
1043
    my $biblio  = $builder->build_sample_biblio();
1044
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1045
    my $itype   = $builder->build_object(
1046
        { class => "Koha::ItemTypes", value => { notforloan => 0 } } );
1047
    my $item_1 = $builder->build_sample_item(
1048
        {
1049
            biblionumber => $biblio->biblionumber,
1050
            itype        => $itype->itemtype,
1051
            library      => $library->branchcode
1052
        }
1053
    );
1054
    my $patron_1 = $builder->build_object( { class => "Koha::Patrons" } );
1055
    my $patron_2 = $builder->build_object( { class => "Koha::Patrons" } );
1056
    my $patron_3 = $builder->build_object( { class => "Koha::Patrons" } );
1057
    my $patron_4 = $builder->build_object( { class => "Koha::Patrons" } );
1058
1059
    # Place a hold on the title for both patrons
1060
    my $priority = 1;
1061
    my $hold_1 = place_item_hold( $patron_1, $item_1, $library, $priority );
1062
    my $hold_2 = place_item_hold( $patron_2, $item_1, $library, $priority );
1063
    my $hold_3 = place_item_hold( $patron_3, $item_1, $library, $priority );
1064
    my $hold_4 = place_item_hold( $patron_4, $item_1, $library, $priority );
1065
1066
    $hold_1->set_waiting;
1067
    AddIssue( $patron_3->unblessed, $item_1->barcode, undef, 'revert' );
1068
1069
    my $holds = $biblio->holds;
1070
    is( $holds->count, 3, 'One hold has been deleted' );
1071
    is_deeply(
1072
        [
1073
            $holds->next->priority, $holds->next->priority,
1074
            $holds->next->priority
1075
        ],
1076
        [ 1, 2, 3 ],
1077
        'priorities have been reordered'
1078
    );
1079
};
1080
1038
sub count_hold_print_messages {
1081
sub count_hold_print_messages {
1039
    my $message_count = $dbh->selectall_arrayref(q{
1082
    my $message_count = $dbh->selectall_arrayref(q{
1040
        SELECT COUNT(*)
1083
        SELECT COUNT(*)
1041
- 

Return to bug 23070