Bugzilla – Attachment 43832 Details for
Bug 14310
Add ability to suspend and resume individual holds from the patron holds table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14310 [QA Followup] - Add unit tests
Bug-14310-QA-Followup---Add-unit-tests.patch (text/plain), 2.27 KB, created by
Kyle M Hall (khall)
on 2015-10-23 13:45:32 UTC
(
hide
)
Description:
Bug 14310 [QA Followup] - Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-10-23 13:45:32 UTC
Size:
2.27 KB
patch
obsolete
>From 506e4b777c9c97b7e02bec140807e2251f21efee Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 16 Oct 2015 11:02:18 -0400 >Subject: [PATCH] Bug 14310 [QA Followup] - Add unit tests > >--- > t/db_dependent/Hold.t | 27 ++++++++++++++++++++++----- > 1 files changed, 22 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t >index ae8c19d..2808c97 100755 >--- a/t/db_dependent/Hold.t >+++ b/t/db_dependent/Hold.t >@@ -23,8 +23,9 @@ use Koha::Database; > use Koha::Borrowers; > use Koha::Branches; > use Koha::Item; >+use Koha::DateUtils; > >-use Test::More tests => 23; >+use Test::More tests => 31; > > use_ok('Koha::Hold'); > >@@ -57,16 +58,32 @@ $item->store(); > > my $hold = Koha::Hold->new( > { >- biblionumber => $biblionumber, >- itemnumber => $item->id(), >- found => 'W', >+ biblionumber => $biblionumber, >+ itemnumber => $item->id(), > waitingdate => '2000-01-01', > borrowernumber => $borrower->borrowernumber(), > branchcode => $branches[1]->branchcode(), >+ suspend => 0, > } > ); > $hold->store(); > >+is( $hold->suspend, 0, "Hold is not suspended" ); >+$hold->suspend_hold(); >+is( $hold->suspend, 1, "Hold is suspended" ); >+$hold->resume(); >+is( $hold->suspend, 0, "Hold is not suspended" ); >+my $dt = dt_from_string(); >+$hold->suspend_hold( $dt ); >+is( $hold->suspend, 1, "Hold is suspended" ); >+is( $hold->suspend_until, "$dt", "Hold is suspended with a date" ); >+$hold->resume(); >+is( $hold->suspend, 0, "Hold is not suspended" ); >+is( $hold->suspend_until, undef, "Hold no longer has suspend_until date" ); >+$hold->found('W'); >+$hold->suspend_hold(); >+is( $hold->suspend, 0, "Waiting hold cannot be suspended" ); >+ > $item = $hold->item(); > > my $hold_borrower = $hold->borrower(); >@@ -74,7 +91,7 @@ ok( $hold_borrower, 'Got hold borrower' ); > is( $hold_borrower->borrowernumber(), $borrower->borrowernumber(), 'Hold borrower matches correct borrower' ); > > C4::Context->set_preference( 'ReservesMaxPickUpDelay', '' ); >-my $dt = $hold->waiting_expires_on(); >+$dt = $hold->waiting_expires_on(); > is( $dt, undef, "Koha::Hold->waiting_expires_on returns undef if ReservesMaxPickUpDelay is not set" ); > > is( $hold->is_waiting, 1, 'The hold is waiting' ); >-- >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 14310
:
39750
|
39751
|
39752
|
39753
|
39754
|
40024
|
40030
|
40031
|
40034
|
43525
|
43526
|
43830
|
43831
|
43832
|
43978
|
44203
|
44204
|
44205
|
44206
|
44207
|
46857
|
46858
|
46859
|
46860
|
46861
|
46862
|
46870
|
46871
|
46872
|
46873
|
46874
|
46875
|
46876