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

(-)a/t/db_dependent/Reserves.t (-2 / +16 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 18;
5
use Test::More tests => 20;
6
use MARC::Record;
6
use MARC::Record;
7
use DateTime::Duration;
7
use DateTime::Duration;
8
8
Lines 270-276 is(exists $messages->{ResFound}?1:0, 1, 'AddReturn considers future reserve with Link Here
270
# End of tests for bug 9761 (ConfirmFutureHolds)
270
# End of tests for bug 9761 (ConfirmFutureHolds)
271
271
272
# test marking a hold as captured
272
# test marking a hold as captured
273
my $hold_notice_count = count_hold_print_messages();
273
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
274
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
275
my $new_count = count_hold_print_messages();
276
is($new_count, $hold_notice_count + 1, 'patron notified when item set to waiting');
277
278
# test that duplicate notices aren't generated
279
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0);
280
$new_count = count_hold_print_messages();
281
is($new_count, $hold_notice_count + 1, 'patron not notified a second time (bug 11445)');
274
282
275
# avoiding the not_same_branch error
283
# avoiding the not_same_branch error
276
t::lib::Mocks::mock_preference('IndependentBranches', 0);
284
t::lib::Mocks::mock_preference('IndependentBranches', 0);
Lines 284-286 my $letter = ReserveSlip('CPL', $requesters{'CPL'}, $bibnum); Link Here
284
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
292
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
285
293
286
$dbh->rollback;
294
$dbh->rollback;
287
- 
295
296
sub count_hold_print_messages {
297
    my $message_count = $dbh->selectall_arrayref(q{
298
        SELECT COUNT(*) FROM message_queue WHERE letter_code = 'HOLD_PRINT'
299
    });
300
    return $message_count->[0]->[0];
301
}

Return to bug 11445