|
Lines 113-118
subtest 'Test indexer calls' => sub {
Link Here
|
| 113 |
|
113 |
|
| 114 |
my $item; |
114 |
my $item; |
| 115 |
my $item2; |
115 |
my $item2; |
|
|
116 |
my $item3; |
| 117 |
my $item4; |
| 118 |
my $item5; |
| 119 |
my $item6; |
| 116 |
warnings_are{ |
120 |
warnings_are{ |
| 117 |
$item = $builder->build_sample_item({ |
121 |
$item = $builder->build_sample_item({ |
| 118 |
biblionumber => $biblio->biblionumber, |
122 |
biblionumber => $biblio->biblionumber, |
|
Lines 126-132
subtest 'Test indexer calls' => sub {
Link Here
|
| 126 |
datelastseen => '2020-11-11', |
130 |
datelastseen => '2020-11-11', |
| 127 |
replacementprice => 0 |
131 |
replacementprice => 0 |
| 128 |
}); |
132 |
}); |
| 129 |
} [$engine,"Koha::Item",$engine,"Koha::Item"], "index_records is called for $engine when adding an item (Item->store)"; |
133 |
$item3 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
|
|
134 |
$item4 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
| 135 |
$item5 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
| 136 |
$item6 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
| 137 |
} [$engine,"Koha::Item", |
| 138 |
$engine,"Koha::Item", |
| 139 |
$engine,"Koha::Item", |
| 140 |
$engine,"Koha::Item", |
| 141 |
$engine,"Koha::Item", |
| 142 |
$engine,"Koha::Item"], "index_records is called for $engine when adding an item (Item->store)"; |
| 130 |
warnings_are{ |
143 |
warnings_are{ |
| 131 |
$item->store({ skip_record_index => 1 }); |
144 |
$item->store({ skip_record_index => 1 }); |
| 132 |
} undef, "index_records is not called for $engine when adding an item (Item->store) if skip_record_index passed"; |
145 |
} undef, "index_records is not called for $engine when adding an item (Item->store) if skip_record_index passed"; |
|
Lines 163-170
subtest 'Test indexer calls' => sub {
Link Here
|
| 163 |
AddReturn($item->barcode, $item->homebranch, 0, undef); |
176 |
AddReturn($item->barcode, $item->homebranch, 0, undef); |
| 164 |
} [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued"; |
177 |
} [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued"; |
| 165 |
|
178 |
|
| 166 |
my $item3 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
|
|
| 167 |
my $item4 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
| 168 |
warnings_are{ |
179 |
warnings_are{ |
| 169 |
$item3->move_to_biblio($biblio2); |
180 |
$item3->move_to_biblio($biblio2); |
| 170 |
} [$engine,"Koha::Item"], "index_records is called for $engine when moving an item to another biblio (Item->move_to_biblio)"; |
181 |
} [$engine,"Koha::Item"], "index_records is called for $engine when moving an item to another biblio (Item->move_to_biblio)"; |
|
Lines 172-179
subtest 'Test indexer calls' => sub {
Link Here
|
| 172 |
$item4->move_to_biblio($biblio2, { skip_record_index => 1 }); |
183 |
$item4->move_to_biblio($biblio2, { skip_record_index => 1 }); |
| 173 |
} undef, "index_records is not called for $engine when moving an item to another biblio (Item->move_to_biblio) if skip_record_index passed"; |
184 |
} undef, "index_records is not called for $engine when moving an item to another biblio (Item->move_to_biblio) if skip_record_index passed"; |
| 174 |
|
185 |
|
| 175 |
my $item5 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
|
|
| 176 |
my $item6 = $builder->build_sample_item({biblionumber => $biblio->biblionumber}); |
| 177 |
warnings_are{ |
186 |
warnings_are{ |
| 178 |
$biblio2->adopt_items_from_biblio($biblio); |
187 |
$biblio2->adopt_items_from_biblio($biblio); |
| 179 |
} [$engine,"Koha::Biblio",$engine,"Koha::Biblio"], "index_records is called for both biblios for $engine when adopting items (Biblio->adopt_items_from_biblio)"; |
188 |
} [$engine,"Koha::Biblio",$engine,"Koha::Biblio"], "index_records is called for both biblios for $engine when adopting items (Biblio->adopt_items_from_biblio)"; |
| 180 |
- |
|
|