Lines 132-138
subtest 'get_elasticsearch_mappings() tests' => sub {
Link Here
|
132 |
|
132 |
|
133 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
133 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { |
134 |
|
134 |
|
135 |
plan tests => 59; |
135 |
plan tests => 61; |
136 |
|
136 |
|
137 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
137 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
138 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
138 |
t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); |
Lines 635-640
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests'
Link Here
|
635 |
ok(defined $exception, "Exception has been thrown when processing mapping with unmatched closing parenthesis"); |
635 |
ok(defined $exception, "Exception has been thrown when processing mapping with unmatched closing parenthesis"); |
636 |
ok($exception->isa("Koha::Exceptions::Elasticsearch::MARCFieldExprParseError"), "Exception is of correct class"); |
636 |
ok($exception->isa("Koha::Exceptions::Elasticsearch::MARCFieldExprParseError"), "Exception is of correct class"); |
637 |
ok($exception->message =~ /Unmatched closing parenthesis/, "Exception has the correct message"); |
637 |
ok($exception->message =~ /Unmatched closing parenthesis/, "Exception has the correct message"); |
|
|
638 |
|
639 |
pop @mappings; |
640 |
my $marc_record_with_blank_field = MARC::Record->new(); |
641 |
$marc_record_with_blank_field->leader(' cam 22 a 4500'); |
642 |
|
643 |
$marc_record_with_blank_field->append_fields( |
644 |
MARC::Field->new('100', '', '', a => ''), |
645 |
MARC::Field->new('210', '', '', a => 'Title 1'), |
646 |
MARC::Field->new('245', '', '', a => 'Title:', b => 'large record'), |
647 |
MARC::Field->new('999', '', '', c => '1234567'), |
648 |
); |
649 |
$docs = $see->marc_records_to_documents([$marc_record_with_blank_field]); |
650 |
is_deeply( $docs->[0]->{author},[],'No value placed into field if mapped marc field is blank'); |
651 |
is_deeply( $docs->[0]->{author__suggestion},[],'No value placed into suggestion if mapped marc field is blank'); |
652 |
|
638 |
}; |
653 |
}; |
639 |
|
654 |
|
640 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
655 |
subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { |
641 |
- |
|
|