Bugzilla – Attachment 25142 Details for
Bug 8918
ILS-DI: HoldTitle and HoldItem do not calculate rank of hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8918: Follow-up for some more unit tests for CalculatePriority
Bug-8918-Follow-up-for-some-more-unit-tests-for-Ca.patch (text/plain), 3.32 KB, created by
Kyle M Hall (khall)
on 2014-02-07 16:25:41 UTC
(
hide
)
Description:
Bug 8918: Follow-up for some more unit tests for CalculatePriority
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-02-07 16:25:41 UTC
Size:
3.32 KB
patch
obsolete
>From 3f97209746acd3c9a54a21b8f312077c5a69f5fc Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 30 Jan 2014 14:16:03 +0100 >Subject: [PATCH] Bug 8918: Follow-up for some more unit tests for CalculatePriority > >Adding a few unit tests, including the following situations: >Placing a hold when there is a wait. >Placing a hold when there is a future hold. >Calculating priority with future date. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Reserves.t | 38 +++++++++++++++++++++++++++++++++++--- > 1 files changed, 35 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 7f43986..31708c2 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 25; >+use Test::More tests => 31; > use MARC::Record; > use DateTime::Duration; > >@@ -319,12 +319,44 @@ is(defined $results[3]?1:0, 1, 'GetReservesFromItemnumber returns a future wait > > # Tests for CalculatePriority (bug 8918) > my $p = C4::Reserves::CalculatePriority($bibnum2); >-is($p, 4, 'CalculatePriority should now return priority 4'); >+is($p, 4, 'CalculatePriority should now return priority 4'); >+$resdate=undef; > AddReserve('CPL', $requesters{'CPL'}, $bibnum2, >- $constraint, $bibitems, $p, undef, $expdate, $notes, >+ $constraint, $bibitems, $p, $resdate, $expdate, $notes, > $title, $checkitem, $found); > $p = C4::Reserves::CalculatePriority($bibnum2); > is($p, 5, 'CalculatePriority should now return priority 5'); >+#some tests on bibnum >+$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); >+$p = C4::Reserves::CalculatePriority($bibnum); >+is($p, 1, 'CalculatePriority should now return priority 1'); >+#add a new reserve and confirm it to waiting >+AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+ $constraint, $bibitems, $p, $resdate, $expdate, $notes, >+ $title, $itemnumber, $found); >+$p = C4::Reserves::CalculatePriority($bibnum); >+is($p, 2, 'CalculatePriority should now return priority 2'); >+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, >+ $constraint, $bibitems, $p, $resdate, $expdate, $notes, >+ $title, $checkitem, $found); >+$p = C4::Reserves::CalculatePriority($bibnum); >+is($p, 2, 'CalculatePriority should now return priority 2'); >+#add another future hold >+C4::Context->set_preference('AllowHoldDateInFuture', 1); >+$resdate= dt_from_string(); >+$resdate->add_duration(DateTime::Duration->new(days => 1)); >+AddReserve('CPL', $requesters{'CPL'}, $bibnum, >+ $constraint, $bibitems, $p, output_pref($resdate), $expdate, $notes, >+ $title, $checkitem, $found); >+$p = C4::Reserves::CalculatePriority($bibnum); >+is($p, 2, 'CalculatePriority should now still return priority 2'); >+#calc priority with future resdate >+$p = C4::Reserves::CalculatePriority($bibnum, $resdate); >+is($p, 3, 'CalculatePriority should now return priority 3'); > # End of tests for bug 8918 > > $dbh->rollback; >-- >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 8918
:
12810
|
13472
|
13565
|
15435
|
17376
|
17881
|
17882
|
17888
|
17889
|
17890
|
21328
|
21329
|
21330
|
22731
|
22732
|
24863
|
24864
|
24880
|
24881
|
24882
|
24883
|
24884
|
24885
|
24886
|
24887
|
24888
|
24920
|
25080
|
25081
|
25082
|
25083
|
25084
|
25118
|
25119
|
25139
|
25140
|
25141
| 25142 |
25143
|
25144