From de8d5f3ae91049252edeabe61e2cbe1d300a999b Mon Sep 17 00:00:00 2001 From: Admin User Koha Date: Mon, 20 Oct 2014 15:05:23 +0200 Subject: [PATCH] Bug 12995 - script update_totalissues.pl stops on corrupted record - UT This patch adds an unit test on C4::Biblio::UpdateTotalIssues method call on non existing record Signed-off-by: Owen Leonard I can't comment on the correctness of the test other than to say it ran successfully. Signed-off-by: Katrin Fischer Improves CLI script, works as described. Note: A small improvement would be to output the problematic biblionumber. --- t/Biblio.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/Biblio.t b/t/Biblio.t index 8662c4000c..67f752d4c5 100755 --- a/t/Biblio.t +++ b/t/Biblio.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 42; +use Test::More tests => 44; use Test::Warn; BEGIN { @@ -155,4 +155,10 @@ warning_is { $ret = RemoveAllNsb() } ok( !defined $ret, 'RemoveAllNsb returns undef if not passed rec'); +warning_is { $ret = UpdateTotalIssues() } + { carped => 'UpdateTotalIssues could not get biblio record'}, + "UpdateTotalIssues returns carped warning if biblio record does not exist"; + +ok( !defined $ret, 'UpdateTotalIssues returns carped warning if biblio record does not exist'); + 1; -- 2.39.5