Bugzilla – Attachment 110880 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.24 KB, created by
Andrew Fuerste-Henry
on 2020-09-28 16:41:32 UTC
(
hide
)
Description:
Bug 25957: Unit test
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-09-28 16:41:32 UTC
Size:
2.24 KB
patch
obsolete
>From 8347ef46f10adf409e3676155dcae27480129e40 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 > >Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> >--- > t/db_dependent/Koha/SearchEngine/Elasticsearch.t | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index 96c8eda321..8db9e9a663 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -132,7 +132,7 @@ subtest 'get_elasticsearch_mappings() tests' => sub { > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { > >- plan tests => 59; >+ plan tests => 61; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); >@@ -635,6 +635,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