View | Details | Raw Unified | Return to bug 33055
Collapse All | Expand All

(-)a/t/db_dependent/SIP/Patron.t (-5 / +19 lines)
Lines 276-282 $schema->storage->txn_rollback; Link Here
276
276
277
subtest "NoIssuesChargeGuarantees tests" => sub {
277
subtest "NoIssuesChargeGuarantees tests" => sub {
278
278
279
    plan tests => 5;
279
    plan tests => 6;
280
280
281
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
281
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
282
282
Lines 320-332 subtest "NoIssuesChargeGuarantees tests" => sub { Link Here
320
320
321
    is( $sip_patron->fines_amount, 0.11,"Guarantee only fines correctly counted");
321
    is( $sip_patron->fines_amount, 0.11,"Guarantee only fines correctly counted");
322
    ok( $sip_patron->charge_ok, "Guarantee not blocked by guarantor fines");
322
    ok( $sip_patron->charge_ok, "Guarantee not blocked by guarantor fines");
323
    unlike( $sip_patron->screen_msg, qr/Patron blocked by fines .* on guaranteed accounts/,"Screen message does not include blocked message");
323
324
324
    $schema->storage->txn_rollback;
325
    $schema->storage->txn_rollback;
325
};
326
};
326
327
327
subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub {
328
subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub {
328
329
329
    plan tests => 6;
330
    plan tests => 12;
330
331
331
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
332
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
332
333
Lines 361-375 subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub { Link Here
361
362
362
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
363
    my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
363
364
364
    is( $sip_patron->fines_amount, 11, "Guarantee fines correctly included");
365
    is( $sip_patron->fines_amount, 11, "Personal fines correctly reported");
365
    ok( !$sip_patron->charge_ok, "Guarantor blocked");
366
    ok( !$sip_patron->charge_ok, "Guarantor blocked");
366
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on related accounts/,"Screen message includes related fines total");
367
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on related accounts/,"Screen message includes related fines total");
367
368
368
    $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber );
369
    $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber );
369
370
370
    is( $sip_patron->fines_amount, 0.11, "Guarantor fines correctly included");
371
    is( $sip_patron->fines_amount, 0.11, "Personal fines correctly reported");
371
    ok( !$sip_patron->charge_ok, "Guarantee blocked");
372
    ok( !$sip_patron->charge_ok, "Guarantee blocked");
372
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on related accounts/,"Screen message includes related fines total");
373
    like( $sip_patron->screen_msg, qr/Patron blocked by fines \(11\.11\) on related accounts/,"Screen message includes related fines total");
373
374
375
    t::lib::Mocks::mock_preference('NoIssuesChargeGuarantorsWithGuarantees', 12.01);
376
377
    $sip_patron = C4::SIP::ILS::Patron->new( $child->cardnumber );
378
379
    is( $sip_patron->fines_amount, 0.11, "Personal fines correctly reported");
380
    ok( $sip_patron->charge_ok, "Guarantee not blocked");
381
    unlike( $sip_patron->screen_msg, qr/Patron blocked by fines .* on related accounts/,"Screen message does not indicate block");
382
383
    $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
384
385
    is( $sip_patron->fines_amount, 11, "Personal fines correctly reported");
386
    ok( $sip_patron->charge_ok, "Patron not blocked");
387
    unlike( $sip_patron->screen_msg, qr/Patron blocked by fines .* on related accounts/,"Screen message does not indicate block");
388
374
    $schema->storage->txn_rollback;
389
    $schema->storage->txn_rollback;
375
};
390
};
376
- 

Return to bug 33055