Bug 12768: Fix up unit tests a bit more
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 12 Oct 2017 16:44:49 +0000 (12:44 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 20 Oct 2017 20:14:35 +0000 (17:14 -0300)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Circulation.t

index ef95eeb..a2dbf33 100755 (executable)
@@ -778,7 +778,9 @@ C4::Context->dbh->do("DELETE FROM accountlines");
     is( $offset->type, 'Fine', 'Account offset type is Fine' );
     is( $offset->amount, '15.000000', 'Account offset amount is 15.00' );
 
-    ModItem({ itype => 'BK' }, $biblionumber, $itemnumber, 1);
+    t::lib::Mocks::mock_preference('WhenLostForgiveFine','0');
+    t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','0');
+
     LostItem( $itemnumber, 1 );
 
     my $item = Koha::Database->new()->schema()->resultset('Item')->find($itemnumber);
@@ -789,13 +791,10 @@ C4::Context->dbh->do("DELETE FROM accountlines");
         undef, $renewing_borrower->{borrowernumber}
     );
 
-    ok( $total_due == 12, 'Borrower only charged replacement fee with both WhenLostForgiveFine and WhenLostChargeReplacementFee enabled' );
+    is( $total_due, '15.000000', 'Borrower only charged replacement fee with both WhenLostForgiveFine and WhenLostChargeReplacementFee enabled' );
 
     C4::Context->dbh->do("DELETE FROM accountlines");
 
-    t::lib::Mocks::mock_preference('WhenLostForgiveFine','0');
-    t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','0');
-
     C4::Overdues::UpdateFine(
         {
             issue_id       => $issue2->id(),