Bug 30254: Unit tests
authorNick Clemens <nick@bywatersolutions.com>
Mon, 31 Oct 2022 18:37:18 +0000 (18:37 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 30 Jan 2023 13:36:24 +0000 (10:36 -0300)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Koha/Item.t

index 04d7465..e23c7da 100755 (executable)
@@ -1471,7 +1471,7 @@ subtest 'store() tests' => sub {
 
     subtest '_set_found_trigger() tests' => sub {
 
-        plan tests => 8;
+        plan tests => 9;
 
         $schema->storage->txn_begin;
 
@@ -1541,6 +1541,14 @@ subtest 'store() tests' => sub {
             'type is correct'
         );
 
+        # Let's build a new item
+        $item   = $builder->build_sample_item({ itemlost => 1, itemlost_on => dt_from_string() });
+        $item->set( { itemlost => 0 } )->store;
+
+        $messages = $item->object_messages;
+        warn Data::Dumper::Dumper( $messages );
+        is( scalar @{$messages}, 0, 'This item has no history, no associated lost fines, presumed not lost by patron, no messages returned');
+
         $schema->storage->txn_rollback;
     };