Bug 23181: 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>
(cherry picked from commit 88db3b587e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
9ce2aa48d8
commit
3facb8c19e
|
|
@ -1041,7 +1041,7 @@ subtest "Payment notice tests" => sub {
|
|||
my $line = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amountoutstanding => 27, interface => 'commandline' })->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');
|
||||
|
|
@ -1053,22 +1053,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue