From 34e42020a90a9a029198461a7f60a4e6b9ee9aa8 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 4 Mar 2014 12:58:28 -0500 Subject: [PATCH] Bug 11634 [QA Followup] - Unit Tests These new unit tests will fail due to the fact that Koha::Database uses a separate dbh handle than C4::Context->dbh --- t/db_dependent/Circulation.t | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 73c0bf3..a51fdad 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -9,7 +9,7 @@ use C4::Items; use C4::Members; use C4::Reserves; -use Test::More tests => 45; +use Test::More tests => 47; BEGIN { use_ok('C4::Circulation'); @@ -261,6 +261,13 @@ C4::Context->dbh->do("DELETE FROM accountlines"); $title, $checkitem, $found ); + C4::Context->set_preference('AllowRenewalIfOtherItemsAvailable', 1 ); + ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); + is( $renewokay, 1, '(Bug 10663) Cannot renew, reserved'); + ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2); + is( $renewokay, 1, '(Bug 10663) Cannot renew, reserved'); + C4::Context->set_preference('AllowRenewalIfOtherItemsAvailable', 0 ); + ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); is( $renewokay, 0, '(Bug 10663) Cannot renew, reserved'); is( $error, 'on_reserve', '(Bug 10663) Cannot renew, reserved (returned error is on_reserve)'); -- 1.7.2.5