Bugzilla – Attachment 117563 Details for
Bug 27784
Unknown authority types break elasticsearch authorities indexing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27784: Unit tests
Bug-27784-Unit-tests.patch (text/plain), 2.72 KB, created by
Martin Renvoize (ashimema)
on 2021-03-03 10:41:31 UTC
(
hide
)
Description:
Bug 27784: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-03 10:41:31 UTC
Size:
2.72 KB
patch
obsolete
>From a6afa8d41dfbb6a9ff86c99eb4f01fd3f0970972 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 26 Feb 2021 14:28:16 +0000 >Subject: [PATCH] Bug 27784: Unit tests > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Koha/SearchEngine/Elasticsearch.t | 25 +++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index c4fe589aa3..62d2291186 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -752,7 +752,7 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () t > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authority tests' => sub { > >- plan tests => 3; >+ plan tests => 5; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); >@@ -773,6 +773,16 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori > sort => 0, > marc_type => 'marc21', > marc_field => '150(aevxyz)', >+ }, >+ { >+ name => 'match', >+ type => 'string', >+ facet => 0, >+ suggestible => 0, >+ searchable => 1, >+ sort => 0, >+ marc_type => 'marc21', >+ marc_field => '185v', > } > ); > >@@ -806,7 +816,11 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori > $marc_record_2->append_fields( > MARC::Field->new('150', '', '', a => 'Subject', v => 'Genresubdiv', z => 'Geosubdiv', x => 'Generalsubdiv', e => 'wrongsubdiv' ), > ); >- my $records = [ $marc_record_1, $marc_record_2 ]; >+ my $marc_record_3 = MARC::Record->new(); >+ $marc_record_3->append_fields( >+ MARC::Field->new('185', '', '', v => 'Formsubdiv' ), >+ ); >+ my $records = [ $marc_record_1, $marc_record_2, $marc_record_3 ]; > > $see->get_elasticsearch_mappings(); #sort_fields will call this and use the actual db values unless we call it first > >@@ -827,6 +841,13 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () authori > $docs->[1]->{'match'} , > "Second record heading should contain the subfields with record order retained" > ); >+ ok( !exists $docs->[2]->{'match-heading'}, "No match heading defined for subdivision record"); >+ is_deeply( >+ [ "Formsubdiv" ], >+ $docs->[2]->{'match'} , >+ "Third record heading should contain the subfield" >+ ); >+ > }; > > $schema->storage->txn_rollback; >-- >2.20.1
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 27784
:
117378
|
117379
|
117401
|
117459
|
117460
| 117563 |
117564