Bugzilla – Attachment 111046 Details for
Bug 26506
Koha::Account::pay will fail if $userenv is not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26506: (QA follow-up) Add Unit Test
Bug-26506-QA-follow-up-Add-Unit-Test.patch (text/plain), 1.39 KB, created by
Martin Renvoize (ashimema)
on 2020-10-01 13:35:06 UTC
(
hide
)
Description:
Bug 26506: (QA follow-up) Add Unit Test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-01 13:35:06 UTC
Size:
1.39 KB
patch
obsolete
>From d6f6db7c3d43cd68250d73a89de42e0bce06ec7f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 1 Oct 2020 14:33:46 +0100 >Subject: [PATCH] Bug 26506: (QA follow-up) Add Unit Test > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Account.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 0941fbbca5..dd54fff601 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -678,7 +678,7 @@ subtest 'reconcile_balance' => sub { > > subtest 'pay() tests' => sub { > >- plan tests => 3; >+ plan tests => 5; > > $schema->storage->txn_begin; > >@@ -719,6 +719,19 @@ subtest 'pay() tests' => sub { > # Disable cash registers > t::lib::Mocks::mock_preference( 'UseCashRegisters', 1 ); > >+ # Undef userenv >+ $context->mock( 'userenv', undef ); >+ my $result = $account->pay( >+ { >+ amount => 20, >+ payment_Type => 'CASH', >+ interface => 'intranet' >+ } >+ ); >+ ok($result, "Koha::Account->pay functions without a userenv"); >+ my $payment = Koha::Account::Lines->find({accountlines_id => $result->{payment_id}}); >+ is($payment->manager_id, undef, "manager_id left undefined when no userenv found"); >+ > $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 26506
:
110552
|
110581
|
111045
| 111046