Bugzilla – Attachment 44729 Details for
Bug 13642
Adding new features for Dublin Core metadata
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13642 - Add Unit test for C4::Record::marc2dcxml
Bug-13642---Add-Unit-test-for-C4Recordmarc2dcxml.patch (text/plain), 4.59 KB, created by
Frédéric Demians
on 2015-11-11 09:21:58 UTC
(
hide
)
Description:
Bug 13642 - Add Unit test for C4::Record::marc2dcxml
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2015-11-11 09:21:58 UTC
Size:
4.59 KB
patch
obsolete
>From 2d0db5c12c72a7dd05459da63a65d7928fc23a3a Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >Date: Mon, 9 Nov 2015 17:17:28 -0600 >Subject: [PATCH] Bug 13642 - Add Unit test for C4::Record::marc2dcxml > >Add Unit test for C4::Record::marc2dcxml > >To test: >Prove t/db_dependent/Record.t > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> >--- > t/db_dependent/Record.t | 55 +++++++++++++++++++++++++++---------------------- > 1 file changed, 30 insertions(+), 25 deletions(-) > >diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t >index 8e806d7..8ad07fd 100755 >--- a/t/db_dependent/Record.t >+++ b/t/db_dependent/Record.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > use MARC::Record; > > use C4::Context; >@@ -50,32 +50,37 @@ is ($marcxml, $testxml, "testing marc2xml"); > my $marcconvert=marcxml2marc($marcxml); > is ($marcconvert->as_xml,$marc->as_xml, "testing xml2marc"); > >-my $marcdc=marc2dcxml($marc); >+my $marcsrwdc=marc2dcxml( $marc, undef, undef, "srwdc" ); > my $test2xml=qq(<?xml version="1.0" encoding="UTF-8"?> >-<metadata >- xmlns="http://example.org/myapp/" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://example.org/myapp/ http://example.org/myapp/schema.xsd" >- xmlns:dc="http://purl.org/dc/elements/1.1/" >- xmlns:dcterms="http://purl.org/dc/terms/"> >-</metadata>); >+<srw_dc:dc xmlns:srw_dc="info:srw/schema/1/dc-schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/z3950/agency/zing/srw/dc-schema.xsd"> >+ <type xmlns="http://purl.org/dc/elements/1.1/"/> >+</srw_dc:dc> >+); > >-is ($marcdc, $test2xml, "testing marc2dcxml"); >+is ($marcsrwdc, $test2xml, "testing SRWDC Metadata"); > >-my $marcqualified=marc2dcxml($marc,1); >+my $marcoaidc=marc2dcxml( $marc, undef, undef, "oaidc" ); > my $test3xml=qq(<?xml version="1.0" encoding="UTF-8"?> >-<metadata >- xmlns="http://example.org/myapp/" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://example.org/myapp/ http://example.org/myapp/schema.xsd" >- xmlns:dc="http://purl.org/dc/elements/1.1/" >- xmlns:dcterms="http://purl.org/dc/terms/"> >-</metadata>); >+<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> >+ <dc:type/> >+ <dc:language/> >+</oai_dc:dc> >+); > >-is ($marcqualified, $test3xml, "testing marcQualified"); >+is ($marcoaidc, $test3xml, "testing OAIDC Metadata"); > >-my $mods=marc2modsxml($marc); >+my $marcrdfdc=marc2dcxml( $marc, undef, undef, "rdfdc" ); > my $test4xml=qq(<?xml version="1.0" encoding="UTF-8"?> >+<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> >+ <dc:type/> >+ <dc:language/> >+</rdf:Description> >+); >+ >+is ($marcrdfdc, $test4xml, "testing OAIDC Metadata"); >+ >+my $mods=marc2modsxml($marc); >+my $test5xml=qq(<?xml version="1.0" encoding="UTF-8"?> > <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" version="3.1" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-1.xsd"> > <typeOfResource/> > <originInfo> >@@ -85,7 +90,7 @@ my $test4xml=qq(<?xml version="1.0" encoding="UTF-8"?> > </mods> > ); > >-is ($mods, $test4xml, "testing marc2modsxml"); >+is ($mods, $test5xml, "testing marc2modsxml"); > > $marc->append_fields(MARC::Field->new( > '100', ' ', ' ', a => 'Rowling, J.K.' >@@ -100,7 +105,7 @@ $marc->append_fields(MARC::Field->new( > #print $endnote; > > my $bibtex=marc2bibtex($marc, 'testID'); >-my $test5xml=qq(\@book{testID, >+my $test6xml=qq(\@book{testID, > author = {Rowling, J.K.}, > title = {Harry potter}, > publisher = {Scholastic}, >@@ -108,11 +113,11 @@ my $test5xml=qq(\@book{testID, > } > ); > >-is ($bibtex, $test5xml, "testing bibtex"); >+is ($bibtex, $test6xml, "testing bibtex"); > > C4::Context->set_preference( "BibtexExportAdditionalFields", "'\@': 260\$b\ntest: 260\$b" ); > $bibtex = marc2bibtex( $marc, 'testID' ); >-my $test6xml = qq(\@Scholastic{testID, >+my $test7xml = qq(\@Scholastic{testID, > \tauthor = {Rowling, J.K.}, > \ttitle = {Harry potter}, > \tpublisher = {Scholastic}, >@@ -120,7 +125,7 @@ my $test6xml = qq(\@Scholastic{testID, > \ttest = {Scholastic} > } > ); >-is( $bibtex, $test6xml, "testing bibtex" ); >+is( $bibtex, $test7xml, "testing bibtex" ); > C4::Context->set_preference( "BibtexExportAdditionalFields", q{} ); > > $marc->append_fields(MARC::Field->new( >-- >2.6.2
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 13642
:
35637
|
35638
|
35639
|
35640
|
35641
|
35642
|
35643
|
35644
|
35645
|
35663
|
35957
|
35981
|
35982
|
35983
|
35999
|
36000
|
36005
|
36006
|
36147
|
36154
|
36631
|
36632
|
36633
|
36636
|
36714
|
38220
|
38819
|
39623
|
39654
|
40786
|
40787
|
42168
|
43311
|
43313
|
43545
|
43548
|
43549
|
43586
|
43612
|
44627
|
44629
|
44658
|
44659
|
44660
|
44661
|
44662
|
44669
|
44672
|
44677
|
44727
|
44728
|
44729
|
44815
|
44816
|
44819
|
45970
|
45971
|
46514
|
46584
|
46585
|
46586
|
46587
|
46588