Bug 19307: Mock the AllowFineOverride preference to ensure expected result

To test:
 1 - Set 'AllowFineOverride' to allow
 2 - prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
 3 - 1 test fails
 4 - Apply patch
 5 - prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
 6 - All tests pass
 7 - Set 'AllowFineOverride' to 'Don't allow'
 8 - Tests should still pass

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1e2e1247c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86612541a4)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Conflicts:
	t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
This commit is contained in:
Nick Clemens 2017-09-13 12:06:50 +00:00 committed by Mason James
parent 0a31ee40d4
commit d2aaa2fbc8
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@ use Modern::Perl;
use Test::More tests => 2;
use t::lib::TestBuilder;
use t::lib::Mocks;
use C4::Accounts qw( manualinvoice );
use C4::Circulation qw( CanBookBeIssued );
@ -53,7 +54,8 @@ my $guarantee = $builder->build(
}
);
C4::Context->set_preference( 'NoIssuesChargeGuarantees', '5.00' );
t::lib::Mocks::mock_preference( 'NoIssuesChargeGuarantees', '5.00' );
t::lib::Mocks::mock_preference( 'AllowFineOverride', '' );
my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->{barcode} );
is( $issuingimpossible->{DEBT_GUARANTEES}, undef, "Patron can check out item" );