Bugzilla – Attachment 46533 Details for
Bug 14694
Make decreaseloanHighHolds more flexible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14694 [QA Followup] - Fix unit tests
Bug-14694-QA-Followup---Fix-unit-tests.patch (text/plain), 3.07 KB, created by
Kyle M Hall
on 2016-01-12 13:09:13 UTC
(
hide
)
Description:
Bug 14694 [QA Followup] - Fix unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2016-01-12 13:09:13 UTC
Size:
3.07 KB
patch
obsolete
>From 8f46de8e8527e554b9325dfd16b5a40d1147dcd9 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 22 Oct 2015 08:12:10 -0400 >Subject: [PATCH] Bug 14694 [QA Followup] - Fix unit tests > >--- > t/db_dependent/DecreaseLoanHighHolds.t | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t >index 899de0d..d533a3f 100755 >--- a/t/db_dependent/DecreaseLoanHighHolds.t >+++ b/t/db_dependent/DecreaseLoanHighHolds.t >@@ -64,7 +64,7 @@ for my $i ( 1 .. 10 ) { > push( @items, $item ); > } > >-for my $i ( 0 .. 4 ) { >+for my $i ( 0 .. 5 ) { > my $patron = $patrons[$i]; > my $hold = Koha::Hold->new( > { >@@ -92,8 +92,8 @@ my $item_hr = { itemnumber => $item->id, biblionumber => $biblio->id, homebranch > my $patron_hr = { borrower => $patron->id, branchcode => 'MPL' }; > > my $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >-is( $data->{outstanding}, 5, "Should have 5 outstanding holds" ); >+is( $data->{exceeded}, 1, "Static mode should exceed threshold" ); >+is( $data->{outstanding}, 6, "Should have 5 outstanding holds" ); > is( $data->{duration}, 1, "Should have duration of 1" ); > is( ref( $data->{due_date} ), 'DateTime', "due_date should be a DateTime object" ); > >@@ -113,39 +113,39 @@ for my $i ( 5 .. 10 ) { > } > > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >+is( $data->{exceeded}, 1, "Should exceed threshold of 1" ); > > C4::Context->set_preference( 'decreaseLoanHighHoldsValue', 2 ); > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 0, "Should not exceed threshold" ); >+is( $data->{exceeded}, 0, "Should not exceed threshold of 2" ); > > my $unholdable = pop(@items); > $unholdable->damaged(-1); > $unholdable->store(); > > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >+is( $data->{exceeded}, 1, "Should exceed threshold with one damanged item" ); > > $unholdable->damaged(0); > $unholdable->itemlost(-1); > $unholdable->store(); > > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >+is( $data->{exceeded}, 1, "Should exceed threshold with one lost item" ); > > $unholdable->itemlost(0); > $unholdable->notforloan(-1); > $unholdable->store(); > > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >+is( $data->{exceeded}, 1, "Should exceed threshold wiht one notforloan item" ); > > $unholdable->notforloan(0); > $unholdable->withdrawn(-1); > $unholdable->store(); > > $data = C4::Circulation::checkHighHolds( $item_hr, $patron_hr ); >-is( $data->{exceeded}, 1, "Should exceed threshold" ); >+is( $data->{exceeded}, 1, "Should exceed threshold with one withdrawn item" ); > > $schema->storage->txn_rollback(); > 1; >-- >2.1.4
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 14694
:
42957
|
42958
|
42970
|
43153
|
43513
|
43589
|
43598
|
43752
|
43768
|
43952
|
46532
|
46533
|
46534
|
46535
|
46864
|
46865
|
46866
|
46867
|
46868
|
48576
|
48577
|
48578
|
48579
|
48580
|
48678
|
48804