Bugzilla – Attachment 28873 Details for
Bug 12086
Hold priorities incorrect, when waiting status was reversed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12086 [QA Followup 2] - Implement Jonathan's suggestions
Bug-12086-QA-Followup-2---Implement-Jonathans-sugg.patch (text/plain), 4.41 KB, created by
Kyle M Hall (khall)
on 2014-06-16 15:22:49 UTC
(
hide
)
Description:
Bug 12086 [QA Followup 2] - Implement Jonathan's suggestions
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-16 15:22:49 UTC
Size:
4.41 KB
patch
obsolete
>From 44e85bae1227ab06ca52318a75ccca34ac0a7c1c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 16 Jun 2014 11:22:19 -0400 >Subject: [PATCH] Bug 12086 [QA Followup 2] - Implement Jonathan's suggestions > >--- > .../{Holds_12086.t => Holds/RevertWaitingStatus.t} | 44 ++++++++++---------- > 1 files changed, 22 insertions(+), 22 deletions(-) > rename t/db_dependent/{Holds_12086.t => Holds/RevertWaitingStatus.t} (61%) > >diff --git a/t/db_dependent/Holds_12086.t b/t/db_dependent/Holds/RevertWaitingStatus.t >similarity index 61% >rename from t/db_dependent/Holds_12086.t >rename to t/db_dependent/Holds/RevertWaitingStatus.t >index c0ca74f..4adde49 100755 >--- a/t/db_dependent/Holds_12086.t >+++ b/t/db_dependent/Holds/RevertWaitingStatus.t >@@ -13,11 +13,6 @@ use C4::Items; > use C4::Members; > use C4::Reserves; > >-BEGIN { >- use FindBin; >- use lib $FindBin::Bin; >-} >- > my $dbh = C4::Context->dbh; > > # Start transaction >@@ -28,6 +23,7 @@ $dbh->do("DELETE FROM reserves"); > $dbh->do("DELETE FROM old_reserves"); > > *C4::Context::userenv = \&Mock_userenv; >+ > sub Mock_userenv { > my $userenv = { flags => 1, id => '1', branch => 'CPL' }; > return $userenv; >@@ -38,21 +34,23 @@ my $borrowers_count = 3; > # Setup Test------------------------ > # Helper biblio. > diag("Creating biblio instance for testing."); >-my ($bibnum, $title, $bibitemnum) = create_helper_biblio(); >+my ( $bibnum, $title, $bibitemnum ) = create_helper_biblio(); > > # Helper item for that biblio. > diag("Creating item instance for testing."); >-my $item_barcode = '99999999999999999999'; >-my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL', barcode => $item_barcode } , $bibnum); >+my $item_barcode = 'my_barcode'; >+my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem( >+ { homebranch => 'CPL', holdingbranch => 'CPL', barcode => $item_barcode }, >+ $bibnum ); > > # Create some borrowers > my @borrowernumbers; >-foreach (1..$borrowers_count) { >+foreach my $i ( 1 .. $borrowers_count ) { > my $borrowernumber = AddMember( >- firstname => 'my firstname', >- surname => 'my surname ' . $_, >+ firstname => 'my firstname', >+ surname => 'my surname ' . $i, > categorycode => 'S', >- branchcode => 'CPL', >+ branchcode => 'CPL', > ); > push @borrowernumbers, $borrowernumber; > } >@@ -60,16 +58,16 @@ foreach (1..$borrowers_count) { > my $biblionumber = $bibnum; > > my @branches = GetBranchesLoop(); >-my $branch = $branches[0][0]{value}; >+my $branch = $branches[0][0]{value}; > > # Create five item level holds >-foreach my $borrowernumber ( @borrowernumbers ) { >+foreach my $borrowernumber (@borrowernumbers) { > AddReserve( > $branch, > $borrowernumber, > $biblionumber, > my $constraint = 'a', >- my $bibitems = q{}, >+ my $bibitems = q{}, > my $priority, > my $resdate, > my $expdate, >@@ -81,20 +79,22 @@ foreach my $borrowernumber ( @borrowernumbers ) { > } > > ModReserveAffect( $itemnumber, $borrowernumbers[0] ); >-C4::Circulation::AddIssue( GetMember( borrowernumber => $borrowernumbers[1] ), $item_barcode, my $datedue, my $cancelreserve = 'revert' ); >+C4::Circulation::AddIssue( GetMember( borrowernumber => $borrowernumbers[1] ), >+ $item_barcode, my $datedue, my $cancelreserve = 'revert' ); > >-my $priorities = $dbh->selectall_arrayref("SELECT priority FROM reserves ORDER BY priority ASC"); >-ok( scalar @$priorities == 2, 'Only 2 holds remain in the reserves table' ); >+my $priorities = $dbh->selectall_arrayref( >+ "SELECT priority FROM reserves ORDER BY priority ASC"); >+ok( scalar @$priorities == 2, 'Only 2 holds remain in the reserves table' ); > ok( $priorities->[0]->[0] == 1, 'First hold has a priority of 1' ); > ok( $priorities->[1]->[0] == 2, 'Second hold has a priority of 2' ); > > # Helper method to set up a Biblio. > sub create_helper_biblio { >- my $bib = MARC::Record->new(); >+ my $bib = MARC::Record->new(); > my $title = 'Silence in the library'; > $bib->append_fields( >- MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), >- MARC::Field->new('245', ' ', ' ', a => $title), >+ MARC::Field->new( '100', ' ', ' ', a => 'Moffat, Steven' ), >+ MARC::Field->new( '245', ' ', ' ', a => $title ), > ); >- return ($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); >+ return ( $bibnum, $title, $bibitemnum ) = AddBiblio( $bib, '' ); > } >-- >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 12086
:
27262
|
27263
|
27406
|
27407
|
27428
|
28471
|
28482
|
28873
|
29162
|
29163