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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Kyle Hall 2014-03-04 12:58:28 -05:00 committed by Tomas Cohen Arazi
parent ebf4350735
commit d77f6519f4

View file

@ -26,7 +26,7 @@ use C4::Reserves;
use Koha::DateUtils;
use Koha::Database;
use Test::More tests => 55;
use Test::More tests => 57;
BEGIN {
use_ok('C4::Circulation');
@ -282,6 +282,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 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2);
is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds');
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)');