Bugzilla – Attachment 125595 Details for
Bug 29139
Paying gives ISE if UseEmailReceipts is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29139: Add regression tests
Bug-29139-Add-regression-tests.patch (text/plain), 2.61 KB, created by
Martin Renvoize (ashimema)
on 2021-10-01 09:17:05 UTC
(
hide
)
Description:
Bug 29139: Add regression tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-01 09:17:05 UTC
Size:
2.61 KB
patch
obsolete
>From 75de5521cd5e7b58b9c65acfe7435c5a1e213310 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 30 Sep 2021 10:01:19 -0300 >Subject: [PATCH] Bug 29139: Add regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Account.t | 41 ++++++++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index fa36c4b835..6cb55c29f3 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -684,7 +684,7 @@ subtest 'reconcile_balance' => sub { > > subtest 'pay() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $schema->storage->txn_begin; > >@@ -738,6 +738,45 @@ subtest 'pay() tests' => sub { > my $payment = Koha::Account::Lines->find({accountlines_id => $result->{payment_id}}); > is($payment->manager_id, undef, "manager_id left undefined when no userenv found"); > >+ subtest 'UseEmailReceipts tests' => sub { >+ >+ plan tests => 5; >+ >+ t::lib::Mocks::mock_preference( 'UseEmailReceipts', 1 ); >+ >+ my %params; >+ >+ my $mocked_letters = Test::MockModule->new('C4::Letters'); >+ # we want to test the params >+ $mocked_letters->mock( 'GetPreparedLetter', sub { >+ %params = @_; >+ return 1; >+ }); >+ # we don't care about EnqueueLetter for now >+ $mocked_letters->mock( 'EnqueueLetter', sub { >+ return 1; >+ }); >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $account = $patron->account; >+ >+ my $debit_1 = $account->add_debit( { amount => 5, interface => 'commandline', type => 'OVERDUE' } ); >+ my $debit_2 = $account->add_debit( { amount => 10, interface => 'commandline', type => 'OVERDUE' } ); >+ >+ $account->pay({ amount => 6, lines => [ $debit_1, $debit_2 ] }); >+ my @offsets = @{$params{substitute}{offsets}}; >+ >+ is( scalar @offsets, 2, 'Two offsets related to payment' ); >+ is( ref($offsets[0]), 'Koha::Account::Offset', 'Type is correct' ); >+ is( ref($offsets[1]), 'Koha::Account::Offset', 'Type is correct' ); >+ is( $offsets[0]->type, 'APPLY', 'Only APPLY offsets are passed to the notice' ); >+ is( $offsets[1]->type, 'APPLY', 'Only APPLY offsets are passed to the notice' ); >+ >+ $schema->storage->txn_rollback; >+ }; >+ > $schema->storage->txn_rollback; > }; > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29139
:
125463
|
125464
|
125474
|
125475
|
125476
|
125504
|
125505
|
125506
|
125507
|
125508
|
125509
|
125510
|
125511
|
125512
|
125513
|
125592
|
125593
|
125594
| 125595 |
125596
|
125844
|
125845
|
125846
|
125847
|
125848