Bugzilla – Attachment 24887 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.17 KB, created by
Marcel de Rooy
on 2014-01-30 13:21:23 UTC
(
hide
)
Description:
Bug 8918: Follow-up for some more unit tests for CalculatePriority
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-01-30 13:21:23 UTC
Size:
3.17 KB
patch
obsolete
>From a89975ab1894f733f193b366d4152375d246fa3b 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 >Content-Type: text/plain; charset=utf-8 > >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. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Reserves.t | 37 +++++++++++++++++++++++++++++++++++-- > 1 files changed, 35 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 7f43986..ee61b84 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; > >@@ -320,11 +320,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'); >+$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)); >+$resdate=output_pref($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 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.7.6
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