From 9282de9c744e1a4ab2104c75ba1afb3a6e4195e4 Mon Sep 17 00:00:00 2001
From: Katrin Fischer <katrin.fischer@bsz-bw.de>
Date: Sat, 2 Nov 2019 01:05:06 +0000
Subject: [PATCH] Bug 23181: [18.11] Extend unit tests

Run t/db_dependent/Accounts.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
---
 t/db_dependent/Accounts.t | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t
index f76f85c6f0..83343ec8d5 100644
--- a/t/db_dependent/Accounts.t
+++ b/t/db_dependent/Accounts.t
@@ -1002,7 +1002,7 @@ subtest "Payment notice tests" => sub {
     my $line = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amountoutstanding => 27 })->store();
 
     my $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_PAYMENT' } );
-    $letter->content('[%- USE Price -%]A payment of [% credit.amount * -1 | $Price %] has been applied to your account.');
+    $letter->content('[%- USE Price -%]A payment of [% credit.amount * -1 | $Price %] has been applied to your account. Your [% branch.branchcode %]');
     $letter->store();
 
     t::lib::Mocks::mock_preference('UseEmailReceipts', '0');
@@ -1015,22 +1015,22 @@ subtest "Payment notice tests" => sub {
 
     t::lib::Mocks::mock_preference('UseEmailReceipts', '1');
 
-    $id = $account->pay( { amount => 12 } );
+    $id = $account->pay( { amount => 12, library_id => $branchcode } );
     my $notice = Koha::Notice::Messages->search()->next();
     is( $notice->subject, 'Account payment', 'Notice subject is correct for payment' );
     is( $notice->letter_code, 'ACCOUNT_PAYMENT', 'Notice letter code is correct for payment' );
-    is( $notice->content, 'A payment of 12.00 has been applied to your account.', 'Notice content is correct for payment' );
+    is( $notice->content, "A payment of 12.00 has been applied to your account. Your $branchcode", 'Notice content is correct for payment' );
     $notice->delete();
 
     $letter = Koha::Notice::Templates->find( { code => 'ACCOUNT_WRITEOFF' } );
-    $letter->content('[%- USE Price -%]A writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.');
+    $letter->content('[%- USE Price -%]A writeoff of [% credit.amount * -1 | $Price %] has been applied to your account. Your [% branch.branchcode %]');
     $letter->store();
 
-    $id = $account->pay( { amount => 13, type => 'writeoff' } );
+    $id = $account->pay( { amount => 13, type => 'writeoff', library_id => $branchcode  } );
     $notice = Koha::Notice::Messages->search()->next();
     is( $notice->subject, 'Account writeoff', 'Notice subject is correct for payment' );
     is( $notice->letter_code, 'ACCOUNT_WRITEOFF', 'Notice letter code is correct for writeoff' );
-    is( $notice->content, 'A writeoff of 13.00 has been applied to your account.', 'Notice content is correct for writeoff' );
+    is( $notice->content, "A writeoff of 13.00 has been applied to your account. Your $branchcode", 'Notice content is correct for writeoff' );
 };
 
 1;
-- 
2.11.0