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

(-)a/t/db_dependent/Reserves.t (-2 / +26 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 73;
20
use Test::More tests => 75;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 518-523 $p = C4::Reserves::CalculatePriority($bibnum, $resdate); Link Here
518
is($p, 3, 'CalculatePriority should now return priority 3');
518
is($p, 3, 'CalculatePriority should now return priority 3');
519
# End of tests for bug 8918
519
# End of tests for bug 8918
520
520
521
# regression test for bug 12630
522
# Now there are 2 reserves on $bibnum
523
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1);
524
my $borrowernumber_tmp_1 = AddMember(
525
    firstname =>  'my firstname tmp 1',
526
    surname => 'my surname tmp 1',
527
    categorycode => 'S',
528
    branchcode => 'CPL',
529
);
530
my $borrowernumber_tmp_2 = AddMember(
531
    firstname =>  'my firstname tmp 2',
532
    surname => 'my surname tmp 2',
533
    categorycode => 'S',
534
    branchcode => 'CPL',
535
);
536
my $date_in_future = dt_from_string();
537
$date_in_future = $date_in_future->add_duration(DateTime::Duration->new(days => 1));
538
AddReserve('CPL', $borrowernumber_tmp_1, $bibnum, undef, undef, 3, output_pref($date_in_future));
539
AddReserve('CPL', $borrowernumber_tmp_2, $bibnum, undef, undef, 4);
540
my @r1 = GetReservesFromBorrowernumber( $borrowernumber_tmp_1 );
541
my @r2 = GetReservesFromBorrowernumber( $borrowernumber_tmp_2 );
542
is( $r1[0]->{priority}, 3, 'priority for hold in future should be correct');
543
is( $r2[0]->{priority}, 4, 'priority for hold not in future should be correct');
544
# end of tests for bug 12630
545
521
# Tests for cancel reserves by users from OPAC.
546
# Tests for cancel reserves by users from OPAC.
522
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
547
$dbh->do('DELETE FROM reserves', undef, ($bibnum));
523
AddReserve(
548
AddReserve(
524
- 

Return to bug 12630