Bug 28210: Unit test
Add a unit test to check that skip_record_index is adhered to when passed to LostItem with the force_mark_returned option enabled. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
7b15138278
commit
bc0cf683ee
|
|
@ -61,7 +61,7 @@ subtest 'Test indexer object creation' => sub {
|
|||
};
|
||||
|
||||
subtest 'Test indexer calls' => sub {
|
||||
plan tests => 36;
|
||||
plan tests => 40;
|
||||
|
||||
my @engines = ('Zebra');
|
||||
eval { Koha::SearchEngine::Elasticsearch->get_elasticsearch_params; };
|
||||
|
|
@ -158,6 +158,12 @@ subtest 'Test indexer calls' => sub {
|
|||
warnings_are{
|
||||
AddReturn($item->barcode, $item->homebranch, 0, undef);
|
||||
} [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
|
||||
warnings_are{
|
||||
LostItem( $item->itemnumber, "tests", 1);
|
||||
} [$engine,"Koha::Item"], "index_records is called for $engine when calling LostItem with 'force_mark_returned'";
|
||||
warnings_are{
|
||||
LostItem( $item->itemnumber, "tests", 1, { skip_record_index => 1 });
|
||||
} undef, "index_records is not called for $engine when calling LostItem with 'force_mark_returned' if skip_record_index";
|
||||
|
||||
$item->datelastseen('2020-02-02');
|
||||
$item->store({skip_record_index=>1});
|
||||
|
|
|
|||
Loading…
Reference in New Issue