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

(-)a/t/db_dependent/Reserves.t (-5 / +3 lines)
Lines 709-721 subtest 'ReservesNeedReturns' => sub { Link Here
709
709
710
    $item->onloan('2010-01-01')->store;
710
    $item->onloan('2010-01-01')->store;
711
    $hold = place_item_hold( $patron, $item, $library, $priority );
711
    $hold = place_item_hold( $patron, $item, $library, $priority );
712
    isnt( $hold->priority, 0, 'If ReservesNeedReturns is 0 but item onloan priority must not be set to 0' );
712
    is( $hold->priority, 1, 'If ReservesNeedReturns is 0 but item onloan priority must be set to 1' );
713
    $hold->delete;
713
    $hold->delete;
714
714
715
    t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 0); # '0' means damaged holds not allowed
715
    t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 0); # '0' means damaged holds not allowed
716
    $item->onloan(undef)->damaged(1)->store;
716
    $item->onloan(undef)->damaged(1)->store;
717
    $hold = place_item_hold( $patron, $item, $library, $priority );
717
    $hold = place_item_hold( $patron, $item, $library, $priority );
718
    isnt( $hold->priority, 0, 'If ReservesNeedReturns is 0 but item damaged and not allowed holds on damaged items priority must not be set to 0' );
718
    is( $hold->priority, 1, 'If ReservesNeedReturns is 0 but item damaged and not allowed holds on damaged items priority must be set to 1' );
719
    $hold->delete;
719
    $hold->delete;
720
    t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 1); # '0' means damaged holds not allowed
720
    t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 1); # '0' means damaged holds not allowed
721
    $hold = place_item_hold( $patron, $item, $library, $priority );
721
    $hold = place_item_hold( $patron, $item, $library, $priority );
Lines 724-734 subtest 'ReservesNeedReturns' => sub { Link Here
724
724
725
    my $hold_1 = place_item_hold( $patron, $item, $library, $priority );
725
    my $hold_1 = place_item_hold( $patron, $item, $library, $priority );
726
    $hold = place_item_hold( $patron_2, $item, $library, $priority );
726
    $hold = place_item_hold( $patron_2, $item, $library, $priority );
727
    isnt( $hold->priority, 0, 'If ReservesNeedReturns is 0 but item already on hold priority must not be set to 0' );
727
    is( $hold->priority, 1, 'If ReservesNeedReturns is 0 but item already on hold priority must be set to 1' );
728
    $hold->delete;
728
    $hold->delete;
729
    $hold_1->delete;
729
    $hold_1->delete;
730
730
731
    $hold->delete;
732
    $builder->build({ source => "Branchtransfer", value => {
731
    $builder->build({ source => "Branchtransfer", value => {
733
        itemnumber  => $item->itemnumber,
732
        itemnumber  => $item->itemnumber,
734
        datearrived => undef,
733
        datearrived => undef,
735
- 

Return to bug 23964