From 01aa46e37f67c3509a4d1bc7cb287f239f1e6136 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 22 Aug 2017 16:45:30 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 14385: Improve C4::Record::marcrecord2csv test cases Signed-off-by: Aleisha Amohia --- t/db_dependent/Record/marcrecord2csv.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Record/marcrecord2csv.t b/t/db_dependent/Record/marcrecord2csv.t index e5cf0d3..025e8c3 100644 --- a/t/db_dependent/Record/marcrecord2csv.t +++ b/t/db_dependent/Record/marcrecord2csv.t @@ -1,7 +1,7 @@ #!/usr/bin/perl; use Modern::Perl; -use Test::More tests => 11; +use Test::More tests => 12; use Test::MockModule; use MARC::Record; use MARC::Field; @@ -29,7 +29,11 @@ my $csv_content = q(Title=245$a|Author=245$c|Subject=650$a); my $csv_profile_id_1 = insert_csv_profile({ csv_content => $csv_content }); my $csv = Text::CSV::Encoded->new(); -my $csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_1, 1, $csv ); +# Test bad biblionumber case +my $csv_output = C4::Record::marcrecord2csv( -1, $csv_profile_id_1, 1, $csv ); +ok (! defined $csv_output, 'Bad biblionumber gives undef as expected.'); + +$csv_output = C4::Record::marcrecord2csv( $biblionumber, $csv_profile_id_1, 1, $csv ); is( $csv_output, q[Title|Author|Subject "The art of computer programming,The art of another title"|"Donald E. Knuth.,Donald E. Knuth. II"|"Computer programming.,Computer algorithms." -- 2.1.4