Bugzilla – Attachment 168146 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.57 KB, created by
Matt Blenkinsop
on 2024-06-26 13:56:18 UTC
(
hide
)
Description:
Bug 28575: (QA follow-up): Add further unit tests
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-06-26 13:56:18 UTC
Size:
3.57 KB
patch
obsolete
>From 951a7bd2b7eca8659f8f49666cac160d197ada68 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 >--- > 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 d079324c9b..9aa310bc31 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -6812,7 +6812,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 5df382edf5..628cb6dae2 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1902,7 +1902,7 @@ subtest 'store() tests' => sub { > > subtest '_set_found_trigger() tests' => sub { > >- plan tests => 9; >+ plan tests => 13; > > $schema->storage->txn_begin; > >@@ -1979,6 +1979,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.3 (Apple Git-146)
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