|
Lines 261-272
subtest 'Test AddRenewal indexer call' => sub {
Link Here
|
| 261 |
t::lib::Mocks::mock_preference( 'SearchEngine', $engine ); |
261 |
t::lib::Mocks::mock_preference( 'SearchEngine', $engine ); |
| 262 |
my $mock_index = Test::MockModule->new("Koha::SearchEngine::".$engine."::Indexer"); |
262 |
my $mock_index = Test::MockModule->new("Koha::SearchEngine::".$engine."::Indexer"); |
| 263 |
|
263 |
|
| 264 |
$mock_index->mock( index_records => sub { |
|
|
| 265 |
warn $engine; |
| 266 |
my ($package, undef, undef) = caller; |
| 267 |
warn $package; |
| 268 |
}); |
| 269 |
|
| 270 |
my $biblio = $builder->build_sample_biblio(); |
264 |
my $biblio = $builder->build_sample_biblio(); |
| 271 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
265 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 272 |
my $item = $builder->build_sample_item({ |
266 |
my $item = $builder->build_sample_item({ |
|
Lines 282-287
subtest 'Test AddRenewal indexer call' => sub {
Link Here
|
| 282 |
} |
276 |
} |
| 283 |
}); |
277 |
}); |
| 284 |
|
278 |
|
|
|
279 |
$mock_index->mock( index_records => sub { |
| 280 |
warn $engine; |
| 281 |
my ($package, undef, undef) = caller; |
| 282 |
warn $package; |
| 283 |
}); |
| 284 |
|
| 285 |
|
| 285 |
warnings_are{ |
286 |
warnings_are{ |
| 286 |
AddRenewal($patron->borrowernumber, $item->itemnumber, $item->homebranch, undef, undef, undef, 0); |
287 |
AddRenewal($patron->borrowernumber, $item->itemnumber, $item->homebranch, undef, undef, undef, 0); |
| 287 |
} [$engine,"Koha::Item"], "index_records is called for $engine when adding a renewal (AddRenewal())"; |
288 |
} [$engine,"Koha::Item"], "index_records is called for $engine when adding a renewal (AddRenewal())"; |
| 288 |
- |
|
|