https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33608

--- Comment #99 from Marcel de Rooy <[email protected]> ---
(In reply to Tomás Cohen Arazi from comment #98)
> This doesn't seem to have added tests for ->store()...

Please clarify what you exactly miss?

I am seeing:

+    subtest 'itemlost / statistics' => sub {    # TODO BZ 34308 (gt zero
checks)
+        plan tests => 5;
+
+        my $item = $builder->build_sample_item;
+        $item->itemlost(-1)->store;             # weird value; >0 test not
triggered ?
+        is( Koha::Statistics->search( { itemnumber => $item->id } )->count, 0,
'No statistics added' );
+        $item->itemlost(1)->store;
+        is( Koha::Statistics->search( { itemnumber => $item->id } )->count, 1,
'statistics added' );
+        $item->itemlost(2)->store;
+        is( Koha::Statistics->search( { itemnumber => $item->id } )->count, 1,
'No statistics added, already lost' );
+        $item->itemlost(-1)->store;             # weird value; <=0 test
triggered ?
+        is( Koha::Statistics->search( { itemnumber => $item->id } )->count, 2,
'statistics added' );
+        $item->itemlost(-2)->store;             # weird value, but no status
change
+        is( Koha::Statistics->search( { itemnumber => $item->id } )->count, 2,
'No statistics added, already *found*' );
+    };

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to