Bug 33411: Unit test update
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
2a2284ceeb
commit
fe1c67b3d7
1 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
@ -312,11 +314,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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue