Lines 117-123
subtest 'get_elasticsearch_mappings() tests' => sub {
Link Here
|
117 |
|
117 |
|
118 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
118 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
119 |
|
119 |
|
120 |
plan tests => 49; |
120 |
plan tests => 50; |
121 |
|
121 |
|
122 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
122 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
123 |
|
123 |
|
Lines 239-244
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
239 |
marc_type => 'marc21', |
239 |
marc_type => 'marc21', |
240 |
marc_field => 'leader_/6-7', |
240 |
marc_field => 'leader_/6-7', |
241 |
}, |
241 |
}, |
|
|
242 |
{ |
243 |
name => 'ff7-00', |
244 |
type => 'string', |
245 |
facet => 0, |
246 |
suggestible => 0, |
247 |
sort => 0, |
248 |
marc_type => 'marc21', |
249 |
marc_field => '007_/0', |
250 |
}, |
242 |
); |
251 |
); |
243 |
|
252 |
|
244 |
my $se = Test::MockModule->new('Koha::SearchEngine::Elasticsearch'); |
253 |
my $se = Test::MockModule->new('Koha::SearchEngine::Elasticsearch'); |
Lines 268-273
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
268 |
$marc_record_1->leader(' cam 22 a 4500'); |
277 |
$marc_record_1->leader(' cam 22 a 4500'); |
269 |
$marc_record_1->append_fields( |
278 |
$marc_record_1->append_fields( |
270 |
MARC::Field->new('001', '123'), |
279 |
MARC::Field->new('001', '123'), |
|
|
280 |
MARC::Field->new('007', 'ku'), |
271 |
MARC::Field->new('020', '', '', a => '1-56619-909-3'), |
281 |
MARC::Field->new('020', '', '', a => '1-56619-909-3'), |
272 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
282 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
273 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
283 |
MARC::Field->new('110', '', '', a => 'Corp Author'), |
Lines 301-306
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
301 |
|
311 |
|
302 |
is_deeply($docs->[0][1]->{control_number}, ['123'], 'First record control number should be set correctly'); |
312 |
is_deeply($docs->[0][1]->{control_number}, ['123'], 'First record control number should be set correctly'); |
303 |
|
313 |
|
|
|
314 |
is_deeply($docs->[0][1]->{'ff7-00'}, ['k'], 'First record ff7-00 should be set correctly'); |
315 |
|
304 |
is(scalar @{$docs->[0][1]->{author}}, 2, 'First document author field should contain two values'); |
316 |
is(scalar @{$docs->[0][1]->{author}}, 2, 'First document author field should contain two values'); |
305 |
is_deeply($docs->[0][1]->{author}, ['Author 1', 'Corp Author'], 'First document author field should be set correctly'); |
317 |
is_deeply($docs->[0][1]->{author}, ['Author 1', 'Corp Author'], 'First document author field should be set correctly'); |
306 |
|
318 |
|
307 |
- |
|
|