[Koha-bugs] [Bug 33608] Allow to get statistics about found/recovered books
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Oct 26 08:10:34 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33608
--- Comment #99 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(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.
More information about the Koha-bugs
mailing list