Lines 756-775
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
756 |
$marc_record_with_large_field->leader(' cam 22 a 4500'); |
756 |
$marc_record_with_large_field->leader(' cam 22 a 4500'); |
757 |
|
757 |
|
758 |
$marc_record_with_large_field->append_fields( |
758 |
$marc_record_with_large_field->append_fields( |
759 |
MARC::Field->new('100', '', '', a => 'Author 1'), |
759 |
MARC::Field->new( '100', '', '', a => 'Author 1' ), |
760 |
MARC::Field->new('245', '', '', a => 'Title:', b => 'record with large field'), |
760 |
MARC::Field->new( '245', '', '', a => 'Title:', b => 'record with large field' ), |
761 |
MARC::Field->new('500', '', '', a => 'X' x 15000), |
761 |
MARC::Field->new( '500', '', '', a => 'X' x 15000 ), |
762 |
MARC::Field->new('999', '', '', c => '1234567'), |
762 |
MARC::Field->new( '999', '', '', c => '1234567' ), |
763 |
); |
763 |
); |
764 |
|
764 |
|
765 |
$docs = $see->marc_records_to_documents([$marc_record_with_large_field]); |
765 |
$docs = $see->marc_records_to_documents( [$marc_record_with_large_field] ); |
766 |
|
766 |
|
767 |
is($docs->[0]->{marc_format}, 'MARCXML', 'For record with large field marc_format should be set correctly'); |
767 |
is( $docs->[0]->{marc_format}, 'MARCXML', 'For record with large field marc_format should be set correctly' ); |
768 |
|
768 |
|
769 |
$decoded_marc_record = $see->decode_record_from_result($docs->[0]); |
769 |
$decoded_marc_record = $see->decode_record_from_result( $docs->[0] ); |
770 |
|
770 |
|
771 |
ok($decoded_marc_record->isa('MARC::Record'), "MARCXML record successfully decoded from result"); |
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"); |
772 |
is( |
|
|
773 |
$decoded_marc_record->as_xml_record(), $marc_record_with_large_field->as_xml_record(), |
774 |
"Decoded MARCXML record has same data as original record" |
775 |
); |
773 |
|
776 |
|
774 |
}; |
777 |
}; |
775 |
|
778 |
|
776 |
- |
|
|