Bug 8918: (follow-up) support creating brief UNIAMRC bibs in Reserves.t
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 7 Feb 2014 11:05:24 +0000 (12:05 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 10 Mar 2014 17:35:38 +0000 (17:35 +0000)
Changed title and author field for UNIMARC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested for MARC21, NORMARC and UNIMARC by adding temporary set_preference..

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/db_dependent/Reserves.t

index 1ea6f82..4b0058c 100755 (executable)
@@ -46,13 +46,19 @@ foreach my $addcat ('S', 'PT') {
 diag("\nCreating biblio instance for testing.");
 my $bib = MARC::Record->new();
 my $title = 'Silence in the library';
-$bib->append_fields(
-    MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
-    MARC::Field->new('245', ' ', ' ', a => $title),
-);
+if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
+    $bib->append_fields(
+        MARC::Field->new('600', '', '1', a => 'Moffat, Steven'),
+        MARC::Field->new('200', '', '', a => $title),
+    );
+}
+else {
+    $bib->append_fields(
+        MARC::Field->new('100', '', '', a => 'Moffat, Steven'),
+        MARC::Field->new('245', '', '', a => $title),
+    );
+}
 my ($bibnum, $bibitemnum);
-# If marcflavour is UNIMARC, AddBiblio fails and all following tests fail too.
-C4::Context->set_preference('marcflavour', 'MARC21');
 ($bibnum, $title, $bibitemnum) = AddBiblio($bib, '');
 
 # Helper item for that biblio.