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" ); |