Bugzilla – Attachment 172256 Details for
Bug 28575
Add ability to choose if lost fee is refunded based on when lost fee was paid off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28575: (QA follow-up): Add further unit tests
Bug-28575-QA-follow-up-Add-further-unit-tests.patch (text/plain), 3.61 KB, created by
Nick Clemens (kidclamp)
on 2024-10-01 11:08:53 UTC
(
hide
)
Description:
Bug 28575: (QA follow-up): Add further unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-10-01 11:08:53 UTC
Size:
3.61 KB
patch
obsolete
>From fc7c21c81dfd833c037f061792b7785d7184018d Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 26 Jun 2024 13:55:04 +0000 >Subject: [PATCH] Bug 28575: (QA follow-up): Add further unit tests > >This patch adds further unit tests for the messaging in _set_found_trigger > >prove t/db_dependent/Koha/Item.t > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 1 - > t/db_dependent/Koha/Item.t | 52 +++++++++++++++++++++++++++++++++++- > 2 files changed, 51 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 0073876e517..0921dfb6448 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -6868,7 +6868,6 @@ subtest 'NoRefundOnLostFinesPaidAge' => sub { > date => '1970-01-01 14:00:01', > amountoutstanding => 0, > amount => -5, >- > interface => 'commandline', > credit_type_code => 'PAYMENT' > } >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 9fa642be693..e10d4f83f72 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -2260,7 +2260,7 @@ subtest 'store() tests' => sub { > > subtest '_set_found_trigger() tests' => sub { > >- plan tests => 9; >+ plan tests => 13; > > $schema->storage->txn_begin; > >@@ -2337,6 +2337,56 @@ subtest 'store() tests' => sub { > $messages = $item->object_messages; > is( scalar @{$messages}, 0, 'This item has no history, no associated lost fines, presumed not lost by patron, no messages returned'); > >+ # NoRefundOnLostFinesPaidAge >+ t::lib::Mocks::mock_preference( 'NoRefundOnLostFinesPaidAge', 10 ); >+ $mocked_circ_rules->mock( 'get_lostreturn_policy', sub { return { lostreturn => 'refund' }; } ); >+ >+ $item = $builder->build_sample_item( { itemlost => 1, itemlost_on => dt_from_string() } ); >+ my $fine = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->id, >+ date => '1970-01-01 14:00:01', >+ amount => 5, >+ amountoutstanding => 0, >+ interface => 'commandline', >+ debit_type_code => 'LOST', >+ itemnumber => $item->itemnumber >+ } >+ )->store(); >+ my $payment = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->id, >+ date => '1970-01-01 14:00:01', >+ amountoutstanding => 0, >+ amount => -5, >+ interface => 'commandline', >+ credit_type_code => 'PAYMENT' >+ } >+ )->store(); >+ my $offset = Koha::Account::Offset->new( >+ { >+ credit_id => $payment->id, >+ debit_id => $fine->id, >+ type => 'APPLY', >+ amount => -5, >+ created_on => '1971-01-01 14:00:01' >+ } >+ )->store(); >+ >+ $item->set( { itemlost => 0 } )->store; >+ >+ $messages = $item->object_messages; >+ >+ is( >+ scalar @{$messages}, 1, >+ 'This item has one message assigned' >+ ); >+ >+ my $message = $messages->[0]; >+ is( $message->type, 'info', 'type is correct' ); >+ is( $message->message, 'payment_not_refunded', 'message is correct' ); >+ is( $message->payload, undef, 'no payload' ); >+ > $schema->storage->txn_rollback; > }; > >-- >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 28575
:
167567
|
167568
|
167569
|
167621
|
167622
|
167623
|
167624
|
167627
|
167635
|
167636
|
167637
|
167638
|
168146
|
172252
|
172253
|
172254
|
172255
| 172256 |
172257
|
172258