Bugzilla – Attachment 92814 Details for
Bug 23321
Add 'cash registers' to the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23321: (follow-up) Add test for Koha::Account change
Bug-23321-follow-up-Add-test-for-KohaAccount-chang.patch (text/plain), 2.23 KB, created by
Martin Renvoize (ashimema)
on 2019-09-13 16:04:45 UTC
(
hide
)
Description:
Bug 23321: (follow-up) Add test for Koha::Account change
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-09-13 16:04:45 UTC
Size:
2.23 KB
patch
obsolete
>From 4bc61f50517d87648c4716822d23d0224e9e514c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 13 Sep 2019 17:04:00 +0100 >Subject: [PATCH] Bug 23321: (follow-up) Add test for Koha::Account change > >--- > t/db_dependent/Koha/Account.t | 27 ++++++++++++++++++++++++--- > 1 file changed, 24 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index e3b7472f7a..da892dbbf6 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -158,7 +158,7 @@ subtest 'outstanding_credits() tests' => sub { > > subtest 'add_credit() tests' => sub { > >- plan tests => 16; >+ plan tests => 17; > > $schema->storage->txn_begin; > >@@ -231,18 +231,39 @@ subtest 'add_credit() tests' => sub { > is( $offset_2->debit_id, undef, 'No debit_id is set for credits' ); > > my $line_3 = $account->add_credit( >- { amount => 20, >+ { >+ amount => 20, > description => 'Manual credit applied', > library_id => $patron->branchcode, > user_id => $patron->id, > type => 'forgiven', >- interface => 'commandline' >+ interface => 'intranet' > } > ); > > is( $schema->resultset('ActionLog')->count(), $action_logs + 2, 'Log was added' ); > is( $schema->resultset('Statistic')->count(), $statistics + 2, 'No action added to statistics, because of credit type' ); > >+ # Enable cash registers >+ t::lib::Mocks::mock_preference( 'UseCashRegisters', 1 ); >+ throws_ok { >+ $account->add_credit( >+ { >+ amount => 20, >+ description => 'Cash payment without cash register', >+ library_id => $patron->branchcode, >+ user_id => $patron->id, >+ payment_type => 'CASH', >+ interface => 'intranet' >+ } >+ ); >+ } >+ 'Koha::Exceptions::Account::RegisterRequired', >+ 'Exception thrown if cash regisers are enabled, a CASH payemtn type is used and not register is passed'; >+ >+ # Disable cash registers >+ t::lib::Mocks::mock_preference( 'UseCashRegisters', 1 ); >+ > $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 23321
:
91596
|
91597
|
91598
|
91599
|
91600
|
91601
|
91602
|
91621
|
92057
|
92058
|
92059
|
92060
|
92061
|
92062
|
92063
|
92064
|
92065
|
92083
|
92084
|
92085
|
92086
|
92087
|
92088
|
92089
|
92090
|
92091
|
92394
|
92395
|
92396
|
92397
|
92398
|
92399
|
92400
|
92401
|
92402
|
92467
|
92468
|
92469
|
92470
|
92471
|
92472
|
92473
|
92474
|
92475
|
92803
|
92804
|
92805
|
92806
|
92807
|
92808
|
92809
|
92810
|
92811
|
92812
|
92813
|
92814
|
92829
|
92879
|
92880
|
92881
|
92882
|
92883
|
92884
|
92885
|
92886
|
92887
|
92888
|
92889
|
93019
|
93020
|
93021
|
93022
|
93023
|
93024
|
93025
|
93026
|
93027
|
93028
|
93029
|
93030
|
93031
|
93032
|
93033
|
93034
|
93035
|
93188