Bugzilla – Attachment 106660 Details for
Bug 25957
Elasticsearch 5.X - empty subfields cause error on suggestible fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25957: Unit test
Bug-25957-Unit-test.patch (text/plain), 2.13 KB, created by
Nick Clemens (kidclamp)
on 2020-07-08 17:31:40 UTC
(
hide
)
Description:
Bug 25957: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-07-08 17:31:40 UTC
Size:
2.13 KB
patch
obsolete
>From 9455b95b21de7158167f8ea0ae5b25ddef488345 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 8 Jul 2020 17:29:45 +0000 >Subject: [PATCH] Bug 25957: Unit test > >--- > t/Koha/SearchEngine/Elasticsearch.t | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/SearchEngine/Elasticsearch.t b/t/Koha/SearchEngine/Elasticsearch.t >index fede84ca34..bf6ade9d58 100644 >--- a/t/Koha/SearchEngine/Elasticsearch.t >+++ b/t/Koha/SearchEngine/Elasticsearch.t >@@ -118,7 +118,7 @@ subtest 'get_elasticsearch_mappings() tests' => sub { > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { > >- plan tests => 53; >+ plan tests => 55; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); >@@ -554,6 +554,21 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > ok(defined $exception, "Exception has been thrown when processing mapping with unmatched closing parenthesis"); > ok($exception->isa("Koha::Exceptions::Elasticsearch::MARCFieldExprParseError"), "Exception is of correct class"); > ok($exception->message =~ /Unmatched closing parenthesis/, "Exception has the correct message"); >+ >+ pop @mappings; >+ my $marc_record_with_blank_field = MARC::Record->new(); >+ $marc_record_with_blank_field->leader(' cam 22 a 4500'); >+ >+ $marc_record_with_blank_field->append_fields( >+ MARC::Field->new('100', '', '', a => ''), >+ MARC::Field->new('210', '', '', a => 'Title 1'), >+ MARC::Field->new('245', '', '', a => 'Title:', b => 'large record'), >+ MARC::Field->new('999', '', '', c => '1234567'), >+ ); >+ $docs = $see->marc_records_to_documents([$marc_record_with_blank_field]); >+ is_deeply( $docs->[0]->{author},[],'No value placed into field if mapped marc field is blank'); >+ is_deeply( $docs->[0]->{author__suggestion},[],'No value placed into suggestion if mapped marc field is blank'); >+ > }; > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25957
:
106660
|
106661
|
110877
|
110878
|
110880
|
110881
|
111240
|
111241