diff --git a/t/slubsipbuilderbagit.t b/t/slubsipbuilderbagit.t index 9f38643d34f3e8f51a3a96c41316d1ba59686b6f..4ca8fe78617b570d69aff687fe428ef79cef7e94 100644 --- a/t/slubsipbuilderbagit.t +++ b/t/slubsipbuilderbagit.t @@ -195,6 +195,18 @@ throws_ok{ SLUB::LZA::SIPBuilderBagIt::get_marc21_text_node(undef, { tag => "245 throws_ok{ SLUB::LZA::SIPBuilderBagIt::get_marc21_text_node($marc21, "" ); } qr/not a mapping hash/, "get_marc21_text_node(), invalid"; throws_ok{ SLUB::LZA::SIPBuilderBagIt::get_marc21_text_node($marc21, undef); } qr/not a mapping hash/, "get_marc21_text_node(), invalid"; # +my $marc_xml_unpatched = << "MARCXML"; +<?xml version="1.0"?> +<record xmlns="http://www.loc.gov/MARC21/slim"> +</record> +MARCXML +my $marc_doc = XML::LibXML->load_xml(string=>$marc_xml_unpatched); +ok( SLUB::LZA::SIPBuilderBagIt::add_marc21_schema_location($marc_doc), "add_marc21_schema_location(), valid"); +like( $marc_doc->serialize(), qr/xsi:schemaLocation/, "add_marc21_schema_location(), valid"); +throws_ok{ SLUB::LZA::SIPBuilderBagIt::add_marc21_schema_location(0); } qr/marc xml document required/, "add_marc21_schema_location(), invalid"; +throws_ok{ SLUB::LZA::SIPBuilderBagIt::add_marc21_schema_location(""); } qr/marc xml document required/, "add_marc21_schema_location(), invalid"; +throws_ok{ SLUB::LZA::SIPBuilderBagIt::add_marc21_schema_location(undef); } qr/marc xml document required/, "add_marc21_schema_location(), invalid"; +# my @baginfo_got = @addBagInfo; my @baginfo_expected = @addBagInfo; push @baginfo_expected, (