Bug 20815: Do not use compare float with precision
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 6 Jul 2020 11:03:21 +0000 (07:03 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 23 Jul 2020 08:04:31 +0000 (10:04 +0200)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/db_dependent/Circulation.t

index 2be657d..b886a7b 100755 (executable)
@@ -4131,10 +4131,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge = undef' => sub {
         }
     );
     ok( $a, "Found accountline for lost fee" );
-    is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" );
     my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string );
     $a = Koha::Account::Lines->find( $a->id );
-    is( $a->amountoutstanding, '0.000000', "Lost fee was refunded" );
+    is( $a->amountoutstanding + 0, 0, "Lost fee was refunded" );
 };
 
 subtest 'Tests for NoRefundOnLostReturnedItemsAge > length of days item has been lost' => sub {
@@ -4206,10 +4206,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge > length of days item has been
         }
     );
     ok( $a, "Found accountline for lost fee" );
-    is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" );
     my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string );
     $a = Koha::Account::Lines->find( $a->id );
-    is( $a->amountoutstanding, '0.000000', "Lost fee was refunded" );
+    is( $a->amountoutstanding + 0, 0, "Lost fee was refunded" );
 };
 
 subtest 'Tests for NoRefundOnLostReturnedItemsAge = length of days item has been lost' => sub {
@@ -4281,10 +4281,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge = length of days item has been
         }
     );
     ok( $a, "Found accountline for lost fee" );
-    is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" );
     my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string );
     $a = Koha::Account::Lines->find( $a->id );
-    is( $a->amountoutstanding, '42.000000', "Lost fee was not refunded" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee was not refunded" );
 };
 
 subtest 'Tests for NoRefundOnLostReturnedItemsAge < length of days item has been lost' => sub {
@@ -4356,10 +4356,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge < length of days item has been
         }
     );
     ok( $a, "Found accountline for lost fee" );
-    is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" );
     my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string );
     $a = Koha::Account::Lines->find( $a->id );
-    is( $a->amountoutstanding, '42.000000', "Lost fee was not refunded" );
+    is( $a->amountoutstanding + 0, 42, "Lost fee was not refunded" );
 };
 
 $schema->storage->txn_rollback;