Bugzilla – Attachment 174458 Details for
Bug 38270
Add MARCXML options to ElasticsearchMARCFormat
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38270: Add unit tests for MARCXML and MARCXML_COMPRESSED options
Bug-38270-Add-unit-tests-for-MARCXML-and-MARCXMLCO.patch (text/plain), 2.56 KB, created by
Martin Renvoize (ashimema)
on 2024-11-13 11:39:38 UTC
(
hide
)
Description:
Bug 38270: Add unit tests for MARCXML and MARCXML_COMPRESSED options
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-13 11:39:38 UTC
Size:
2.56 KB
patch
obsolete
>From 4ba46137b934297938ee12db694a2c4462cdbcbb Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 11 Nov 2024 05:54:11 +0000 >Subject: [PATCH] Bug 38270: Add unit tests for MARCXML and MARCXML_COMPRESSED > options > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Koha/SearchEngine/Elasticsearch.t | 26 ++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index 48cd2025d8c..d09de13e784 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -186,7 +186,7 @@ subtest 'get_elasticsearch_mappings() tests' => sub { > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { > >- plan tests => 66; >+ plan tests => 72; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); >@@ -752,6 +752,30 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > 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'); > >+ foreach my $syspref_val ( 'MARCXML', 'MARCXML_COMPRESSED' ) { >+ t::lib::Mocks::mock_preference( 'ElasticsearchMARCFormat', $syspref_val ); >+ my $test_record = MARC::Record->new(); >+ $test_record->leader(' cam 22 a 4500'); >+ >+ $test_record->append_fields( >+ MARC::Field->new( '100', '', '', a => 'Author 1' ), >+ MARC::Field->new( '110', '', '', a => 'Corp Author' ), >+ MARC::Field->new( '245', '', '', a => 'Title:', b => 'test record' ), >+ MARC::Field->new( '999', '', '', c => '1234567' ), >+ ); >+ >+ $docs = $see->marc_records_to_documents( [$test_record] ); >+ >+ is( $docs->[0]->{marc_format}, $syspref_val, 'marc_format matches system preference value' ); >+ >+ $decoded_marc_record = $see->decode_record_from_result( $docs->[0] ); >+ >+ ok( $decoded_marc_record->isa('MARC::Record'), "MARCXML record successfully decoded from result" ); >+ is( >+ $decoded_marc_record->as_xml_record(), $test_record->as_xml_record(), >+ "Decoded MARCXML record has same data as original record" >+ ); >+ } > }; > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents_array () tests' => sub { >-- >2.47.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 38270
:
174320
|
174321
|
174322
|
174456
|
174457
| 174458