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

(-)a/t/db_dependent/Koha/Checkout.t (-2 / +4 lines)
Lines 119-133 subtest 'renewals() tests' => sub { Link Here
119
    my $renewal1 = $builder->build_object(
119
    my $renewal1 = $builder->build_object(
120
        {
120
        {
121
            class => 'Koha::Checkouts::Renewals',
121
            class => 'Koha::Checkouts::Renewals',
122
            value => { checkout_id => $checkout->issue_id }
122
            value => { checkout_id => undef }
123
        }
123
        }
124
    );
124
    );
125
    $renewal1->checkout_id( $checkout->issue_id )->store();
125
    my $renewal2 = $builder->build_object(
126
    my $renewal2 = $builder->build_object(
126
        {
127
        {
127
            class => 'Koha::Checkouts::Renewals',
128
            class => 'Koha::Checkouts::Renewals',
128
            value => { checkout_id => $checkout->issue_id }
129
            value => { checkout_id => undef }
129
        }
130
        }
130
    );
131
    );
132
    $renewal2->checkout_id( $checkout->issue_id )->store();
131
133
132
    is( ref( $checkout->renewals ), 'Koha::Checkouts::Renewals', 'Object set type is correct' );
134
    is( ref( $checkout->renewals ), 'Koha::Checkouts::Renewals', 'Object set type is correct' );
133
    is( $checkout->renewals->count, 2,                           "Count of renewals is correct" );
135
    is( $checkout->renewals->count, 2,                           "Count of renewals is correct" );
(-)a/t/db_dependent/Koha/Old/Checkout.t (-2 / +4 lines)
Lines 54-74 subtest 'anonymize() tests' => sub { Link Here
54
        {
54
        {
55
            class => 'Koha::Checkouts::Renewals',
55
            class => 'Koha::Checkouts::Renewals',
56
            value => {
56
            value => {
57
                checkout_id => $checkout_2->id,
57
                checkout_id => undef,
58
                interface   => 'opac',
58
                interface   => 'opac',
59
                renewer_id  => $patron->id
59
                renewer_id  => $patron->id
60
            }
60
            }
61
        }
61
        }
62
    );
62
    );
63
    $renewal_1->checkout_id( $checkout_2->id )->store();
63
    my $renewal_2 = $builder->build_object(
64
    my $renewal_2 = $builder->build_object(
64
        {
65
        {
65
            class => 'Koha::Checkouts::Renewals',
66
            class => 'Koha::Checkouts::Renewals',
66
            value => {
67
            value => {
67
                checkout_id => $checkout_2->id,
68
                checkout_id => undef,
68
                interface   => 'intranet'
69
                interface   => 'intranet'
69
            }
70
            }
70
        }
71
        }
71
    );
72
    );
73
    $renewal_2->checkout_id( $checkout_2->id )->store();
72
74
73
    is( $patron->old_checkouts->count, 2, 'Patron has 2 completed checkouts' );
75
    is( $patron->old_checkouts->count, 2, 'Patron has 2 completed checkouts' );
74
76
(-)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