Bugzilla – Attachment 186571 Details for
Bug 35612
Record branch context in accountlines.branchcode for OVERDUE, LOST, and PROCESSING fees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35612: Tests
Bug-35612-Tests.patch (text/plain), 2.62 KB, created by
Laura Escamilla
on 2025-09-18 17:20:17 UTC
(
hide
)
Description:
Bug 35612: Tests
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-09-18 17:20:17 UTC
Size:
2.62 KB
patch
obsolete
>From 39b5b4cdc89b7af53b578f9263b243a30983fb4f Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Thu, 18 Sep 2025 17:17:24 +0000 >Subject: [PATCH] Bug 35612: Tests > >run perl t/db_dependent/Koha/Account.t >--- > t/db_dependent/Koha/Account.t | 53 ++++++++++++++++++++++++++++++++++- > 1 file changed, 52 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 057c3e9eda..c40cd9ed49 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 16; >+use Test::More tests => 17; > use Test::MockModule; > use Test::Exception; > use Test::Warn; >@@ -466,6 +466,57 @@ subtest 'add_debit() tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'add_debit() populates branchcode according to AccountLinesBranchSource' => sub { >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $item_homebranch = $builder->build_object( { class => 'Koha::Libraries' } )->branchcode; >+ my $checkout_branch = $builder->build_object( { class => 'Koha::Libraries' } )->branchcode; >+ >+ my $item = $builder->build_sample_item( { homebranch => $item_homebranch } ); >+ >+ my $checkout = Koha::Checkout->new( >+ { >+ borrowernumber => $patron->id, >+ itemnumber => $item->itemnumber, >+ branchcode => $checkout_branch, >+ date_due => \'NOW()', >+ issuedate => \'NOW()', >+ } >+ )->store(); >+ my %branch_tests = ( >+ 'checkoutbranch' => $checkout_branch, >+ 'itemhomebranch' => $item_homebranch, >+ 'patronhomebranch' => $patron->branchcode, >+ 'none' => undef, >+ ); >+ for my $pref ( keys %branch_tests ) { >+ t::lib::Mocks::mock_preference( 'AccountLinesBranchSource', $pref ); >+ >+ my $account = $patron->account; >+ >+ my $line = $account->add_debit( >+ { >+ amount => 5, >+ description => "Test $pref", >+ type => 'OVERDUE', >+ interface => 'commandline', >+ item_id => $item->itemnumber, >+ issue_id => $checkout->id, >+ } >+ ); >+ >+ is( >+ $line->branchcode, >+ $branch_tests{$pref}, >+ "branchcode is set correctly for AccountLinesBranchSource = $pref" >+ ); >+ } >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'lines() tests' => sub { > > plan tests => 1; >-- >2.39.5
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 35612
:
186567
|
186568
|
186569
|
186570
| 186571