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

(-)a/t/db_dependent/Koha/Checkout.t (-9 / +7 lines)
Lines 54-79 subtest 'renewals() tests' => sub { Link Here
54
    plan tests => 2;
54
    plan tests => 2;
55
    $schema->storage->txn_begin;
55
    $schema->storage->txn_begin;
56
56
57
    my $checkout = $builder->build_object(
57
    my $checkout = $builder->build_object( { class => 'Koha::Checkouts' } );
58
        {
59
            class => 'Koha::Checkouts'
60
        }
61
    );
62
    my $renewal1 = $builder->build_object(
58
    my $renewal1 = $builder->build_object(
63
        {
59
        {
64
            class => 'Koha::Checkouts::Renewals',
60
            class => 'Koha::Checkouts::Renewals',
65
            value => { checkout_id => $checkout->issue_id }
61
            value => { checkout_id => undef }
66
        }
62
        }
67
    );
63
    );
64
    $renewal1->checkout_id( $checkout->issue_id )->store();
68
    my $renewal2 = $builder->build_object(
65
    my $renewal2 = $builder->build_object(
69
        {
66
        {
70
            class => 'Koha::Checkouts::Renewals',
67
            class => 'Koha::Checkouts::Renewals',
71
            value => { checkout_id => $checkout->issue_id }
68
            value => { checkout_id => undef }
72
        }
69
        }
73
    );
70
    );
71
    $renewal2->checkout_id( $checkout->issue_id )->store();
74
72
75
    is( ref($checkout->renewals), 'Koha::Checkouts::Renewals', 'Object set type is correct' );
73
    is( ref( $checkout->renewals ), 'Koha::Checkouts::Renewals', 'Object set type is correct' );
76
    is( $checkout->renewals->count, 2, "Count of renewals is correct" );
74
    is( $checkout->renewals->count, 2,                           "Count of renewals is correct" );
77
75
78
    $schema->storage->txn_rollback;
76
    $schema->storage->txn_rollback;
79
};
77
};
(-)a/t/db_dependent/Koha/Old/Checkouts.t (-3 / +4 lines)
Lines 93-113 subtest 'anonymize() tests' => sub { Link Here
93
        {
93
        {
94
            class => 'Koha::Checkouts::Renewals',
94
            class => 'Koha::Checkouts::Renewals',
95
            value => {
95
            value => {
96
                checkout_id => $checkout_4->id,
96
                checkout_id => undef,
97
                interface   => 'opac',
97
                interface   => 'opac',
98
                renewer_id  => $patron->id
98
                renewer_id  => $patron->id
99
            }
99
            }
100
        }
100
        }
101
    );
101
    );
102
    $renewal_1->checkout_id( $checkout_4->id )->store();
102
    my $renewal_2 = $builder->build_object(
103
    my $renewal_2 = $builder->build_object(
103
        {
104
        {
104
            class => 'Koha::Checkouts::Renewals',
105
            class => 'Koha::Checkouts::Renewals',
105
            value => {
106
            value => {
106
                checkout_id => $checkout_4->id,
107
                checkout_id => undef,
107
                interface   => 'intranet'
108
                interface   => 'intranet'
108
            }
109
            }
109
        }
110
        }
110
    );
111
    );
112
    $renewal_2->checkout_id( $checkout_4->id )->store();
111
113
112
    is( $patron->old_checkouts->count, 4, 'Patron has 4 completed checkouts' );
114
    is( $patron->old_checkouts->count, 4, 'Patron has 4 completed checkouts' );
113
    is( $checkout_4->renewals->count, 2, 'Checkout 4 has 2 renewals' );
115
    is( $checkout_4->renewals->count, 2, 'Checkout 4 has 2 renewals' );
114
- 

Return to bug 33284