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

(-)a/t/db_dependent/Koha/Patron.t (-2 / +2 lines)
Lines 135-141 subtest 'relationships_debt() tests' => sub { Link Here
135
135
136
sub _test_combinations {
136
sub _test_combinations {
137
    my ( $patrons, $parent1_debt, $parent2_debt, $child1_debt, $child2_debt ) = @_;
137
    my ( $patrons, $parent1_debt, $parent2_debt, $child1_debt, $child2_debt ) = @_;
138
    diag("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt");
138
    note("Testing with parent 1 debt $parent1_debt | Parent 2 debt $parent2_debt | Child 1 debt $child1_debt | Child 2 debt $child2_debt");
139
    # Options
139
    # Options
140
    # P1 => P1 + C1 + C2 ( - P1 ) ( + P2 )
140
    # P1 => P1 + C1 + C2 ( - P1 ) ( + P2 )
141
    # P2 => P2 + C1 + C2 ( - P2 ) ( + P1 )
141
    # P2 => P2 + C1 + C2 ( - P2 ) ( + P1 )
Lines 146-152 sub _test_combinations { Link Here
146
    for my $i ( 0 .. 7 ) {
146
    for my $i ( 0 .. 7 ) {
147
        my ( $only_this_guarantor, $include_guarantors, $include_this_patron )
147
        my ( $only_this_guarantor, $include_guarantors, $include_this_patron )
148
          = split '', sprintf( "%03b", $i );
148
          = split '', sprintf( "%03b", $i );
149
        diag("---------------------");
149
        note("---------------------");
150
        for my $patron ( @$patrons ) {
150
        for my $patron ( @$patrons ) {
151
            if ( $only_this_guarantor
151
            if ( $only_this_guarantor
152
                && !$patron->guarantee_relationships->count )
152
                && !$patron->guarantee_relationships->count )
(-)a/t/db_dependent/SIP/Patron.t (-2 / +5 lines)
Lines 272-283 subtest "fine_items tests" => sub { Link Here
272
    is( @$fine_items, 0, "Got zero fine items" );
272
    is( @$fine_items, 0, "Got zero fine items" );
273
};
273
};
274
274
275
$schema->storage->txn_rollback;
276
275
subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub {
277
subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub {
276
278
277
    plan tests => 1;
279
    plan tests => 1;
278
280
279
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
281
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
280
282
283
    $schema->storage->txn_begin;
284
281
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
285
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
282
    my $child  = $builder->build_object({ class => 'Koha::Patrons' });
286
    my $child  = $builder->build_object({ class => 'Koha::Patrons' });
283
    $child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' });
287
    $child->add_guarantor({ guarantor_id => $patron->borrowernumber, relationship => 'parent' });
Lines 308-312 subtest "NoIssuesChargeGuarantorsWithGuarantees tests" => sub { Link Here
308
312
309
    is( $sip_patron->fines_amount, 11.11,"Guarantee fines correctly included");
313
    is( $sip_patron->fines_amount, 11.11,"Guarantee fines correctly included");
310
314
315
    $schema->storage->txn_rollback;
311
};
316
};
312
$schema->storage->txn_rollback;
313
- 

Return to bug 29754