From 7e7348e030d128fc4800ed05a5514a8fa73ff696 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 7 Apr 2023 18:49:41 +0000 Subject: [PATCH] Bug 33411: Unit test update --- t/db_dependent/SIP/Patron.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/SIP/Patron.t b/t/db_dependent/SIP/Patron.t index 04baa9e7bc..23038174c7 100755 --- a/t/db_dependent/SIP/Patron.t +++ b/t/db_dependent/SIP/Patron.t @@ -284,7 +284,9 @@ subtest "NoIssuesChargeGuarantees tests" => sub { my $patron = $builder->build_object({ class => 'Koha::Patrons' }); my $child = $builder->build_object({ class => 'Koha::Patrons' }); + my $sibling = $builder->build_object({ class => 'Koha::Patrons' }); $child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); + $sibling->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' }); t::lib::Mocks::mock_preference('noissuescharge', 50); t::lib::Mocks::mock_preference('NoIssuesChargeGuarantees', 11.01); @@ -310,11 +312,21 @@ subtest "NoIssuesChargeGuarantees tests" => sub { } )->store; + my $fee3 = $builder->build_object( + { + class => 'Koha::Account::Lines', + value => { + borrowernumber => $sibling->borrowernumber, + amountoutstanding => 11.11, + } + } + )->store; + my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); is( $sip_patron->fines_amount, 11, "Only patron's fines are reported in total"); ok( !$sip_patron->charge_ok, "Guarantor blocked"); - like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on guaranteed accounts/,"Screen message includes related fines total"); + like( $sip_patron->screen_msg, qr/Patron blocked by fines \(22\.22\) on guaranteed accounts/,"Screen message includes related fines total"); $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber ); -- 2.30.2