Bugzilla – Attachment 28657 Details for
Bug 5144
Duplicate holds allowed if patron clicks back button after placing hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5144 [1] - Unit test
Bug-5144-1---Unit-test.patch (text/plain), 3.30 KB, created by
Kyle M Hall (khall)
on 2014-06-04 14:51:49 UTC
(
hide
)
Description:
Bug 5144 [1] - Unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-04 14:51:49 UTC
Size:
3.30 KB
patch
obsolete
>From 77c258ef2742980785d80a291caa6ab0d9b518d1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 4 Jun 2014 09:45:49 -0400 >Subject: [PATCH] Bug 5144 [1] - Unit test > >--- > t/db_dependent/Reserves.t | 25 +++++++++++++++++++++---- > 1 files changed, 21 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 0698534..f864c8b 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 35; >+use Test::More tests => 36; > > use MARC::Record; > use DateTime::Duration; >@@ -137,6 +137,13 @@ $requesters{'CPL'} = AddMember( > categorycode => 'PT', > surname => 'borrower from CPL', > ); >+for my $i ( 2 .. 5 ) { >+ $requesters{"CPL$i"} = AddMember( >+ branchcode => 'CPL', >+ categorycode => 'PT', >+ surname => 'borrower $i from CPL', >+ ); >+} > $requesters{'FPL'} = AddMember( > branchcode => 'FPL', > categorycode => 'PT', >@@ -353,11 +360,12 @@ ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0); #confirm hold > is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait (confirmed future hold)'); > # End of tests for bug 9788 > >+$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); > # Tests for CalculatePriority (bug 8918) > my $p = C4::Reserves::CalculatePriority($bibnum2); > is($p, 4, 'CalculatePriority should now return priority 4'); > $resdate=undef; >-AddReserve('CPL', $requesters{'CPL'}, $bibnum2, >+AddReserve('CPL', $requesters{'CPL2'}, $bibnum2, > $constraint, $bibitems, $p, $resdate, $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum2); >@@ -376,7 +384,7 @@ ModReserveAffect( $itemnumber, $requesters{'CPL'} , 0); > $p = C4::Reserves::CalculatePriority($bibnum); > is($p, 1, 'CalculatePriority should now return priority 1'); > #add another biblio hold, no resdate >-AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+AddReserve('CPL', $requesters{'CPL3'}, $bibnum, > $constraint, $bibitems, $p, $resdate, $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum); >@@ -385,7 +393,7 @@ is($p, 2, 'CalculatePriority should now return priority 2'); > C4::Context->set_preference('AllowHoldDateInFuture', 1); > $resdate= dt_from_string(); > $resdate->add_duration(DateTime::Duration->new(days => 1)); >-AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+AddReserve('CPL', $requesters{'CPL4'}, $bibnum, > $constraint, $bibitems, $p, output_pref($resdate), $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum); >@@ -395,6 +403,15 @@ $p = C4::Reserves::CalculatePriority($bibnum, $resdate); > is($p, 3, 'CalculatePriority should now return priority 3'); > # End of tests for bug 8918 > >+AddReserve( 'CPL', $requesters{'CPL4'}, $bibnum, $constraint, $bibitems, $p, >+ output_pref($resdate), $expdate, $notes, $title, $checkitem, $found ); >+my ($count) = C4::Context->dbh->selectrow_array( >+'SELECT COUNT(*) FROM reserves WHERE biblionumber = ? AND borrowernumber = ?', >+ undef, >+ ( $bibnum, $requesters{'CPL4'} ) >+); >+ok( $count == 1, 'Duplicate hold not placed (Bug 5144)' ); >+ > $dbh->rollback; > > sub count_hold_print_messages { >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5144
:
28657
|
28658
|
28659
|
34983
|
34984
|
34985
|
34986
|
34987
|
34988
|
35090
|
35091
|
35092
|
35093
|
35451
|
40823
|
40824
|
42530
|
42792
|
42848
|
43118
|
43119
|
43120
|
43121
|
43122
|
43125
|
43126
|
43164
|
43165
|
43166
|
43167