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

(-)a/t/db_dependent/Koha/Patrons.t (-3 / +14 lines)
Lines 615-622 subtest 'search_upcoming_membership_expires' => sub { Link Here
615
    Koha::Patrons->search({ borrowernumber => { in => [ $patron_1->{borrowernumber}, $patron_2->{borrowernumber}, $patron_3->{borrowernumber} ] } })->delete;
615
    Koha::Patrons->search({ borrowernumber => { in => [ $patron_1->{borrowernumber}, $patron_2->{borrowernumber}, $patron_3->{borrowernumber} ] } })->delete;
616
};
616
};
617
617
618
subtest 'holds' => sub {
618
subtest 'holds and old_holds' => sub {
619
    plan tests => 3;
619
    plan tests => 6;
620
620
621
    my $library = $builder->build( { source => 'Branch' } );
621
    my $library = $builder->build( { source => 'Branch' } );
622
    my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' );
622
    my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' );
Lines 673-678 subtest 'holds' => sub { Link Here
673
    $holds = $patron->holds;
673
    $holds = $patron->holds;
674
    is( $holds->count, 2, 'There should be 2 holds placed by this patron' );
674
    is( $holds->count, 2, 'There should be 2 holds placed by this patron' );
675
675
676
    my $old_holds = $patron->old_holds;
677
    is( ref($old_holds), 'Koha::Old::Holds',
678
        'Koha::Patron->old_holds should return a Koha::Old::Holds objects' );
679
    is( $old_holds->count, 0, 'There should not be any old holds yet');
680
681
    my $hold = $holds->next;
682
    $hold->cancel;
683
684
    $old_holds = $patron->old_holds;
685
    is( $old_holds->count, 1, 'There should  be 1 old (cancelled) hold');
686
687
    $old_holds->delete;
676
    $holds->delete;
688
    $holds->delete;
677
    $patron->delete;
689
    $patron->delete;
678
};
690
};
679
- 

Return to bug 14919