Bugzilla – Attachment 41972 Details for
Bug 11247
Fix calls of TransformHtmlToXml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11247: Add a simple unit test for TransformHtmlToXml
Bug-11247-Add-a-simple-unit-test-for-TransformHtml.patch (text/plain), 1.55 KB, created by
Marcel de Rooy
on 2015-08-26 12:53:29 UTC
(
hide
)
Description:
Bug 11247: Add a simple unit test for TransformHtmlToXml
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-08-26 12:53:29 UTC
Size:
1.55 KB
patch
obsolete
>From 562d22102ec4344efa520f6176aa22bca1fabdb9 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 26 Aug 2015 14:09:53 +0200 >Subject: [PATCH] Bug 11247: Add a simple unit test for TransformHtmlToXml >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/Biblio_TransformHtmlToXml.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/Biblio_TransformHtmlToXml.t | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > create mode 100644 t/Biblio_TransformHtmlToXml.t > >diff --git a/t/Biblio_TransformHtmlToXml.t b/t/Biblio_TransformHtmlToXml.t >new file mode 100644 >index 0000000..bbf8588 >--- /dev/null >+++ b/t/Biblio_TransformHtmlToXml.t >@@ -0,0 +1,25 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Test::More tests => 4; >+use XML::Simple; >+ >+use C4::Biblio qw/TransformHtmlToXml/; >+ >+my $tags= [ '001', '100', '245', '245' ]; >+my $subfields = [ '', 'a', 'a', 'c' ]; >+my $values = [ '12345', 'author', 'title', 'resp' ]; >+my $ind = [ ' ', '00', ' 9', ' ' ]; >+ >+my $xml = TransformHtmlToXml( $tags, $subfields, $values, $ind, undef, 'MARC21' ); >+my $xmlh = XML::Simple->new->XMLin( $xml ); >+ >+# check number of controlfields >+is( ref $xmlh->{record}->{controlfield}, 'HASH', 'One controlfield' ); >+# check datafields >+my $cnt = @{$xmlh->{record}->{datafield}}; >+is( $cnt, 2, 'Two datafields' ); >+# check value of 245c >+is( $xmlh->{record}->{datafield}->[1]->{subfield}->[1]->{content}, 'resp', 'Check value' ); >+# check second indicator of 245 >+is( $xmlh->{record}->{datafield}->[1]->{ind2}, '9', 'Check indicator' ); >-- >1.7.10.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 11247
:
22923
|
22924
|
22953
|
41911
|
41971
|
41972
|
42088
|
42137
|
42138
|
42226