From a9d4a5cad09f9fd46a21d42cdff9cc7bc987a9ed Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 6 Oct 2017 14:51:10 -0400 Subject: [PATCH] Bug 19066 [QA Followup] - Fix related unit test failures --- C4/Accounts.pm | 2 ++ C4/Circulation.pm | 2 +- t/db_dependent/00-strict.t | 24 ------------------------ t/db_dependent/Circulation/issue.t | 4 ++-- 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 t/db_dependent/00-strict.t diff --git a/C4/Accounts.pm b/C4/Accounts.pm index a963aae..2a2eeb0 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -211,6 +211,8 @@ sub manualinvoice { my $accountno = getnextacctno($borrowernumber); my $amountleft = $amount; + $itemnum ||= undef; + if ( ( $type eq 'L' ) or ( $type eq 'F' ) or ( $type eq 'A' ) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 723796e..8a522f8 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3223,7 +3223,7 @@ sub AddIssuingCharge { my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; - Koha::Account::Line->new( + return Koha::Account::Line->new( { date => dt_from_string(), borrowernumber => $borrowernumber, diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t deleted file mode 100644 index 11e9403..0000000 --- a/t/db_dependent/00-strict.t +++ /dev/null @@ -1,24 +0,0 @@ -# This script is called by the pre-commit git hook to test modules compile - -use strict; -use warnings; -use Test::More; -use Test::Strict; -use File::Spec; -use File::Find; -use lib("misc/translator"); -use lib("installer"); - -my @dirs = ( 'acqui', 'admin', 'authorities', 'basket', - 'catalogue', 'cataloguing', 'changelanguage.pl', 'circ', 'debian', 'docs', - 'edithelp.pl', 'errors', 'fix-perl-path.PL', 'help.pl', 'installer', - 'koha_perl_deps.pl', 'kohaversion.pl', 'labels', - 'mainpage.pl', 'Makefile.PL', 'members', 'misc', 'offline_circ', 'opac', - 'patroncards', 'reports', 'reserve', 'reviews', - 'rewrite-config.PL', 'rotating_collections', 'serials', 'services', 'skel', - 'sms', 'suggestion', 'svc', 'tags', 'tools', 'virtualshelves' ); - -$Test::Strict::TEST_STRICT = 0; -$Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'sms/sms_listen_windows_start.pl', 'misc/plack/koha.psgi' ]; - -all_perl_files_ok(@dirs); diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 2f12201..eb5d3e1 100644 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -207,8 +207,8 @@ $sth = $dbh->prepare($query); $sth->execute; my $countaccount = $sth -> fetchrow_array; is ($countaccount,0,"0 accountline exists"); -is( C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, 10 ), - 1, "An issuing charge has been added" ); +isa_ok( C4::Circulation::AddIssuingCharge( $item_id1, $borrower_id1, 10 ), + 'Koha::Account::Line', "An issuing charge has been added" ); my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef ); $sth->execute; $countaccount = $sth -> fetchrow_array; -- 2.10.2