View | Details | Raw Unified | Return to bug 28210
Collapse All | Expand All

(-)a/t/db_dependent/Koha/SearchEngine/Indexer.t (-5 / +19 lines)
Lines 115-126 subtest 'Test indexer calls' => sub { Link Here
115
            $item = $builder->build_sample_item({
115
            $item = $builder->build_sample_item({
116
                biblionumber => $biblio->biblionumber,
116
                biblionumber => $biblio->biblionumber,
117
                onloan => '2020-02-02',
117
                onloan => '2020-02-02',
118
                datelastseen => '2020-01-01'
118
                datelastseen => '2020-01-01',
119
                replacementprice => 0
119
            });
120
            });
120
            $item2 = $builder->build_sample_item({
121
            $item2 = $builder->build_sample_item({
121
                biblionumber => $biblio->biblionumber,
122
                biblionumber => $biblio->biblionumber,
122
                onloan => '2020-12-12',
123
                onloan => '2020-12-12',
123
                datelastseen => '2020-11-11'
124
                datelastseen => '2020-11-11',
125
                replacementprice => 0
124
            });
126
            });
125
        } [$engine,"Koha::Item",$engine,"Koha::Item"], "index_records is called for $engine when adding an item (Item->store)";
127
        } [$engine,"Koha::Item",$engine,"Koha::Item"], "index_records is called for $engine when adding an item (Item->store)";
126
        warnings_are{
128
        warnings_are{
Lines 158-172 subtest 'Test indexer calls' => sub { Link Here
158
        warnings_are{
160
        warnings_are{
159
            AddReturn($item->barcode, $item->homebranch, 0, undef);
161
            AddReturn($item->barcode, $item->homebranch, 0, undef);
160
        } [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
162
        } [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
163
        $builder->build({
164
            source => 'Issue',
165
            value  => {
166
                itemnumber => $item->itemnumber
167
            }
168
        });
169
        $item->onloan('2000-01-01')->store({ skip_record_index => 1 });
161
        warnings_are{
170
        warnings_are{
162
            LostItem( $item->itemnumber, "tests", 1);
171
            LostItem( $item->itemnumber, "tests", 1);
163
        } [$engine,"Koha::Item"], "index_records is called for $engine when calling LostItem with 'force_mark_returned'";
172
        } [$engine,"Koha::Item"], "index_records is called for $engine when calling LostItem with 'force_mark_returned'";
173
        $builder->build({
174
            source => 'Issue',
175
            value  => {
176
                itemnumber => $item->itemnumber
177
            }
178
        });
179
        $item->onloan('2000-01-01')->store({ skip_record_index => 1 });
164
        warnings_are{
180
        warnings_are{
165
            LostItem( $item->itemnumber, "tests", 1, { skip_record_index => 1 });
181
            LostItem( $item->itemnumber, "tests", 1, { skip_record_index => 1 });
166
        } undef, "index_records is not called for $engine when calling LostItem with 'force_mark_returned' if skip_record_index";
182
        } undef, "index_records is not called for $engine when calling LostItem with 'force_mark_returned' if skip_record_index";
167
183
168
        $item->datelastseen('2020-02-02');
184
        $item->datelastseen('2001-01-01')->store({skip_record_index=>1});
169
        $item->store({skip_record_index=>1});
170
        warnings_are{
185
        warnings_are{
171
            my $t1 = ModDateLastSeen( $item->itemnumber, 1, undef );
186
            my $t1 = ModDateLastSeen( $item->itemnumber, 1, undef );
172
        } [$engine, "Koha::Item"], "index_records is called for $engine when calling ModDateLastSeen";
187
        } [$engine, "Koha::Item"], "index_records is called for $engine when calling ModDateLastSeen";
173
- 

Return to bug 28210