|
Lines 212-218
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
| 212 |
plan tests => 70; |
212 |
plan tests => 70; |
| 213 |
|
213 |
|
| 214 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
214 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
| 215 |
t::lib::Mocks::mock_preference( 'ElasticsearchMARCFormat', 'ISO2709' ); |
215 |
t::lib::Mocks::mock_preference( 'ElasticsearchMARCFormat', 'base64ISO2709' ); |
| 216 |
|
216 |
|
| 217 |
my @mappings = ( |
217 |
my @mappings = ( |
| 218 |
{ |
218 |
{ |
|
Lines 626-639
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
| 626 |
|
626 |
|
| 627 |
ok( defined $docs->[0]->{marc_data}, 'First document marc_data field should be set' ); |
627 |
ok( defined $docs->[0]->{marc_data}, 'First document marc_data field should be set' ); |
| 628 |
ok( defined $docs->[0]->{marc_format}, 'First document marc_format field should be set' ); |
628 |
ok( defined $docs->[0]->{marc_format}, 'First document marc_format field should be set' ); |
| 629 |
is( $docs->[0]->{marc_format}, 'base64ISO2709', 'First document marc_format should be set correctly' ); |
629 |
is( $docs->[0]->{marc_format}, 'base64base64ISO2709', 'First document marc_format should be set correctly' ); |
| 630 |
|
630 |
|
| 631 |
my $decoded_marc_record = $see->decode_record_from_result( $docs->[0] ); |
631 |
my $decoded_marc_record = $see->decode_record_from_result( $docs->[0] ); |
| 632 |
|
632 |
|
| 633 |
ok( $decoded_marc_record->isa('MARC::Record'), "base64ISO2709 record successfully decoded from result" ); |
633 |
ok( $decoded_marc_record->isa('MARC::Record'), "base64base64ISO2709 record successfully decoded from result" ); |
| 634 |
is( |
634 |
is( |
| 635 |
$decoded_marc_record->as_usmarc(), $marc_record_1->as_usmarc(), |
635 |
$decoded_marc_record->as_usmarc(), $marc_record_1->as_usmarc(), |
| 636 |
"Decoded base64ISO2709 record has same data as original record" |
636 |
"Decoded base64base64ISO2709 record has same data as original record" |
| 637 |
); |
637 |
); |
| 638 |
|
638 |
|
| 639 |
is( scalar @{ $docs->[0]->{type_of_record} }, 1, 'First document type_of_record field should have one value' ); |
639 |
is( scalar @{ $docs->[0]->{type_of_record} }, 1, 'First document type_of_record field should have one value' ); |
|
Lines 744-750
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
| 744 |
|
744 |
|
| 745 |
ok( !( defined $docs->[0]->{unimarc_title} ), "No mapping when marc_type doesn't match marc flavour" ); |
745 |
ok( !( defined $docs->[0]->{unimarc_title} ), "No mapping when marc_type doesn't match marc flavour" ); |
| 746 |
|
746 |
|
| 747 |
# Marc serialization format fallback for records exceeding ISO2709 max record size |
747 |
# Marc serialization format fallback for records exceeding base64ISO2709 max record size |
| 748 |
|
748 |
|
| 749 |
my $large_marc_record = MARC::Record->new(); |
749 |
my $large_marc_record = MARC::Record->new(); |
| 750 |
$large_marc_record->leader(' cam 22 a 4500'); |
750 |
$large_marc_record->leader(' cam 22 a 4500'); |
|
Lines 970-976
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori
Link Here
|
| 970 |
plan tests => 5; |
970 |
plan tests => 5; |
| 971 |
|
971 |
|
| 972 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
972 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
| 973 |
t::lib::Mocks::mock_preference( 'ElasticsearchMARCFormat', 'ISO2709' ); |
973 |
t::lib::Mocks::mock_preference( 'ElasticsearchMARCFormat', 'base64ISO2709' ); |
| 974 |
|
974 |
|
| 975 |
my $builder = t::lib::TestBuilder->new; |
975 |
my $builder = t::lib::TestBuilder->new; |
| 976 |
my $auth_type = |
976 |
my $auth_type = |
| 977 |
- |
|
|