From b1c7f52abfcd3689fb80584056c37bc108b5ef6b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Feb 2019 08:41:29 +0000 Subject: [PATCH] Bug 21756: (follow-up) Add test for deprecation warning Signed-off-by: Martin Renvoize --- t/db_dependent/Accounts.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index ae71655179..69a794a380 100644 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -18,7 +18,7 @@ use Modern::Perl; -use Test::More tests => 36; +use Test::More tests => 37; use Test::MockModule; use Test::Warn; @@ -91,7 +91,12 @@ $dbh->do(q|DELETE FROM accountlines|); # Test manualinvoice, reuse some of the vars from testing chargelostitem my $type = 'L'; my $note = 'Test note!'; -manualinvoice( $patron->{borrowernumber}, $item->{itemnumber}, $description, $type, $amount, $note ); +warning_like { + C4::Accounts::manualinvoice( $patron->{borrowernumber}, + $item->{itemnumber}, $description, $type, $amount, $note ) +} +qr/C4::Accounts::manualinvoice is deprecated in favor of Koha::Account->add_debit/, + "deprecation warning recieved for manualinvoice"; ($accountline) = Koha::Account::Lines->search( { borrowernumber => $patron->{borrowernumber} -- 2.20.1