Bugzilla – Attachment 55954 Details for
Bug 17377
ES - control fields are not taken into account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17377: Add tests for json2marc
Bug-17377-Add-tests-for-json2marc.patch (text/plain), 1.60 KB, created by
Nick Clemens
on 2016-09-30 10:28:06 UTC
(
hide
)
Description:
Bug 17377: Add tests for json2marc
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2016-09-30 10:28:06 UTC
Size:
1.60 KB
patch
obsolete
>From a6f61cc81f9b36165146ff41ec5f7387df6cedb7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Sep 2016 16:41:53 +0100 >Subject: [PATCH] Bug 17377: Add tests for json2marc > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../Koha_SearchEngine_Elasticsearch_Search.t | 24 +++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >index ac20414..43f8faf 100644 >--- a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >+++ b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 10; >+use Test::More tests => 11; > > use Koha::SearchEngine::Elasticsearch::QueryBuilder; > >@@ -57,4 +57,26 @@ SKIP: { > > } > >+subtest 'json2marc' => sub { >+ plan tests => 4; >+ my $leader = '00626nam a2200193 4500'; >+ my $_001 = 42; >+ my $_010a = '123456789'; >+ my $_010d = 145; >+ my $_200a = 'a title'; >+ my $json = [ # It's not a JSON, see the POD of json2marc >+ [ 'LDR', undef, undef, '_', $leader ], >+ [ '001', undef, undef, '_', $_001 ], >+ [ '010', ' ', ' ', 'a', $_010a, 'd', $_010d ], >+ [ '200', '1', ' ', 'a', $_200a, ], # Yes UNIMARC but we don't mind here >+ ]; >+ >+ my $marc = $searcher->json2marc( $json ); >+ is( $marc->leader, $leader, ); >+ is( $marc->field('001')->data, $_001, ); >+ is( $marc->subfield('010', 'a'), $_010a, ); >+ is( $marc->subfield('200', 'a'), $_200a, ); >+ >+}; >+ > 1; >-- >2.1.4
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 17377
:
55932
|
55933
|
55954
|
55955
|
57620
|
57621