From 905d24a9e044ad644b42e5acd489ec3cedc7ae93 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Wed, 6 Apr 2011 10:07:29 -0400 Subject: [PATCH] Add unit tests to ensure bug 5683 doesn't reappear Signed-off-by: Jared Camins-Esakov Signed-off-by: Chris Cormack Signed-off-by: Ian Walls (cherry picked from commit d949472324b37b4484ec962bf96722c118a2bac2) Signed-off-by: Chris Nighswonger --- t/db_dependent/Biblio.t | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 6012f5f80d..dd827f0c6c 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 9; use MARC::Record; use C4::Biblio; @@ -34,6 +34,40 @@ my $itemdata = &GetBiblioItemData($biblioitemnumber); is($itemdata->{title},$title,'First test of GetBiblioItemData to get same result of previous two GetBiblioData tests.'); is($itemdata->{isbn},$isbn,'Second test checking it returns the correct isbn.'); +my $success = 0; +$field = MARC::Field->new( + 655, ' ', ' ', + 'a' => 'Auction catalogs', + '9' => '1' + ); +eval { + $marc_record->append_fields($field); + $success = ModBiblio($marc_record,$biblionumber,''); +} or do { + diag($@); + $success = 0; +}; +ok($success, "ModBiblio handles authority-linked 655"); + +eval { + $field->delete_subfields('a'); + $marc_record->append_fields($field); + $success = ModBiblio($marc_record,$biblionumber,''); +} or do { + diag($@); + $success = 0; +}; +ok($success, "ModBiblio handles 655 with authority link but no heading"); + +eval { + $field->delete_subfields('9'); + $marc_record->append_fields($field); + $success = ModBiblio($marc_record,$biblionumber,''); +} or do { + diag($@); + $success = 0; +}; +ok($success, "ModBiblio handles 655 with no subfields"); # clean up after ourselves DelBiblio($biblionumber); -- 2.39.5