|
Lines 186-192
subtest 'get_elasticsearch_mappings() tests' => sub {
Link Here
|
| 186 |
|
186 |
|
| 187 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
187 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
| 188 |
|
188 |
|
| 189 |
plan tests => 66; |
189 |
plan tests => 69; |
| 190 |
|
190 |
|
| 191 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
191 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
| 192 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
192 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
|
Lines 752-757
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
| 752 |
is_deeply( $docs->[0]->{author},[],'No value placed into field if mapped marc field is blank'); |
752 |
is_deeply( $docs->[0]->{author},[],'No value placed into field if mapped marc field is blank'); |
| 753 |
is_deeply( $docs->[0]->{author__suggestion},[],'No value placed into suggestion if mapped marc field is blank'); |
753 |
is_deeply( $docs->[0]->{author__suggestion},[],'No value placed into suggestion if mapped marc field is blank'); |
| 754 |
|
754 |
|
|
|
755 |
my $marc_record_with_large_field = MARC::Record->new(); |
| 756 |
$marc_record_with_large_field->leader(' cam 22 a 4500'); |
| 757 |
|
| 758 |
$marc_record_with_large_field->append_fields( |
| 759 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
| 760 |
MARC::Field->new('245', '', '', a => 'Title:', b => 'record with large field'), |
| 761 |
MARC::Field->new('500', '', '', a => 'X' x 15000), |
| 762 |
MARC::Field->new('999', '', '', c => '1234567'), |
| 763 |
); |
| 764 |
|
| 765 |
$docs = $see->marc_records_to_documents([$marc_record_with_large_field]); |
| 766 |
|
| 767 |
is($docs->[0]->{marc_format}, 'MARCXML', 'For record with large field marc_format should be set correctly'); |
| 768 |
|
| 769 |
$decoded_marc_record = $see->decode_record_from_result($docs->[0]); |
| 770 |
|
| 771 |
ok($decoded_marc_record->isa('MARC::Record'), "MARCXML record successfully decoded from result"); |
| 772 |
is($decoded_marc_record->as_xml_record(), $marc_record_with_large_field->as_xml_record(), "Decoded MARCXML record has same data as original record"); |
| 773 |
|
| 755 |
}; |
774 |
}; |
| 756 |
|
775 |
|
| 757 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
776 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
| 758 |
- |
|
|