Skip to content
Snippets Groups Projects
Commit a68fa8fd authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- added test cases

parent 2b6ad7c0
Branches
No related tags found
No related merge requests found
...@@ -195,6 +195,18 @@ throws_ok{ SLUB::LZA::SIPBuilderBagIt::get_marc21_text_node(undef, { tag => "245 ...@@ -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, "" ); } 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"; 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_got = @addBagInfo;
my @baginfo_expected = @addBagInfo; my @baginfo_expected = @addBagInfo;
push @baginfo_expected, ( push @baginfo_expected, (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment