Bug 21756: (follow-up) Add test for deprecation warning
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 21 Feb 2019 08:41:29 +0000 (08:41 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 13 Mar 2019 03:58:31 +0000 (03:58 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

t/db_dependent/Accounts.t

index 921b4bc..2dfe97b 100644 (file)
@@ -18,7 +18,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 33;
+use Test::More tests => 34;
 use Test::MockModule;
 use Test::Warn;
 
@@ -79,7 +79,12 @@ my $amount = '5.000000';
 my $description = "Test fee!";
 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";
 my ($accountline) = Koha::Account::Lines->search(
     {
         borrowernumber => $patron->{borrowernumber}