Lines 118-124
subtest 'get_elasticsearch_mappings() tests' => sub {
Link Here
|
118 |
|
118 |
|
119 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
119 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
120 |
|
120 |
|
121 |
plan tests => 53; |
121 |
plan tests => 55; |
122 |
|
122 |
|
123 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
123 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
124 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
124 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
Lines 554-559
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
554 |
ok(defined $exception, "Exception has been thrown when processing mapping with unmatched closing parenthesis"); |
554 |
ok(defined $exception, "Exception has been thrown when processing mapping with unmatched closing parenthesis"); |
555 |
ok($exception->isa("Koha::Exceptions::Elasticsearch::MARCFieldExprParseError"), "Exception is of correct class"); |
555 |
ok($exception->isa("Koha::Exceptions::Elasticsearch::MARCFieldExprParseError"), "Exception is of correct class"); |
556 |
ok($exception->message =~ /Unmatched closing parenthesis/, "Exception has the correct message"); |
556 |
ok($exception->message =~ /Unmatched closing parenthesis/, "Exception has the correct message"); |
|
|
557 |
|
558 |
pop @mappings; |
559 |
my $marc_record_with_blank_field = MARC::Record->new(); |
560 |
$marc_record_with_blank_field->leader(' cam 22 a 4500'); |
561 |
|
562 |
$marc_record_with_blank_field->append_fields( |
563 |
MARC::Field->new('100', '', '', a => ''), |
564 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
565 |
MARC::Field->new('245', '', '', a => 'Title:', b => 'large record'), |
566 |
MARC::Field->new('999', '', '', c => '1234567'), |
567 |
); |
568 |
$docs = $see->marc_records_to_documents([$marc_record_with_blank_field]); |
569 |
is_deeply( $docs->[0]->{author},[],'No value placed into field if mapped marc field is blank'); |
570 |
is_deeply( $docs->[0]->{author__suggestion},[],'No value placed into suggestion if mapped marc field is blank'); |
571 |
|
557 |
}; |
572 |
}; |
558 |
|
573 |
|
559 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
574 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
560 |
- |
|
|