Bugzilla – Attachment 44995 Details for
Bug 15062
Holds queue with Transport Cost Matrix will transfer item even if transfers disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15062 [QA Followup] - Unit Test
Bug-15062-QA-Followup---Unit-Test.patch (text/plain), 3.11 KB, created by
Kyle M Hall (khall)
on 2015-11-19 12:55:05 UTC
(
hide
)
Description:
Bug 15062 [QA Followup] - Unit Test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-11-19 12:55:05 UTC
Size:
3.11 KB
patch
obsolete
>From 444694b84af0e14bc42c985a198e054856b4483a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 19 Nov 2015 12:50:45 +0000 >Subject: [PATCH] Bug 15062 [QA Followup] - Unit Test > >--- > t/db_dependent/HoldsQueue.t | 49 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 1c07fa5..fb26c11 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -12,7 +12,7 @@ use C4::Context; > > use Data::Dumper; > >-use Test::More tests => 22; >+use Test::More tests => 23; > > use C4::Branch; > use C4::ItemType; >@@ -364,6 +364,53 @@ $holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice > is( @$holds_queue, 1, "Bug 14297 - Holds Queue building ignoring holds where pickup & home branch don't match and item is not from le"); > # End Bug 14297 > >+# Bug 15062 >+$itemtype = $item_types[0]->{itemtype}; >+$borrowernumber = $borrower2->{borrowernumber}; >+$library_A = $library1->{branchcode}; >+$library_B = $library2->{branchcode}; >+$dbh->do("DELETE FROM reserves"); >+$dbh->do("DELETE FROM issues"); >+$dbh->do("DELETE FROM items"); >+$dbh->do("DELETE FROM biblio"); >+$dbh->do("DELETE FROM biblioitems"); >+$dbh->do("DELETE FROM transport_cost"); >+$dbh->do("DELETE FROM tmp_holdsqueue"); >+$dbh->do("DELETE FROM hold_fill_targets"); >+$dbh->do("DELETE FROM default_branch_circ_rules"); >+$dbh->do("DELETE FROM default_branch_item_rules"); >+$dbh->do("DELETE FROM default_circ_rules"); >+$dbh->do("DELETE FROM branch_item_rules"); >+ >+C4::Context->set_preference("UseTransportCostMatrix",1); >+ >+my $tc_rs = $schema->resultset('TransportCost'); >+$tc_rs->create({ frombranch => $library_A, tobranch => $library_B, cost => 0, disable_transfer => 1 }); >+$tc_rs->create({ frombranch => $library_B, tobranch => $library_A, cost => 0, disable_transfer => 1 }); >+ >+$dbh->do(" >+ INSERT INTO biblio (frameworkcode, author, title, datecreated) VALUES ('', 'Koha test', '$TITLE', '2011-02-01') >+"); >+ >+$biblionumber = $dbh->selectrow_array("SELECT biblionumber FROM biblio WHERE title = '$TITLE'") >+ or BAIL_OUT("Cannot find newly created biblio record"); >+ >+$dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) VALUES ($biblionumber, '', '$itemtype')"); >+ >+$biblioitemnumber = >+ $dbh->selectrow_array("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber = $biblionumber") >+ or BAIL_OUT("Cannot find newly created biblioitems record"); >+ >+$dbh->do(" >+ INSERT INTO items (biblionumber, biblioitemnumber, homebranch, holdingbranch, notforloan, damaged, itemlost, withdrawn, onloan, itype) >+ VALUES ($biblionumber, $biblioitemnumber, '$library_A', '$library_A', 0, 0, 0, 0, NULL, '$itemtype') >+"); >+ >+$reserve_id = AddReserve ( $library_B, $borrowernumber, $biblionumber, '', 1 ); >+C4::HoldsQueue::CreateQueue(); >+$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); >+is( @$holds_queue, 0, "Bug 15062 - Holds queue with Transport Cost Matrix will transfer item even if transfers disabled"); >+# End Bug 15062 > > # Cleanup > $schema->storage->txn_rollback; >-- >1.7.10.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 15062
:
43984
|
44202
|
44993
|
44994
|
44995
|
44996
|
45041
|
45042