@@ -, +, @@ --- t/db_dependent/Koha/Checkout.t | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) --- a/t/db_dependent/Koha/Checkout.t +++ a/t/db_dependent/Koha/Checkout.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 1; +use Test::More tests => 2; use t::lib::TestBuilder; use Koha::Database; @@ -48,3 +48,32 @@ subtest 'library() tests' => sub { $schema->storage->txn_rollback; }; + +subtest 'renewals() tests' => sub { + + plan tests => 2; + $schema->storage->txn_begin; + + my $checkout = $builder->build_object( + { + class => 'Koha::Checkouts' + } + ); + my $renewal1 = $builder->build_object( + { + class => 'Koha::Checkouts::Renewals', + value => { checkout_id => $checkout->issue_id } + } + ); + my $renewal2 = $builder->build_object( + { + class => 'Koha::Checkouts::Renewals', + value => { checkout_id => $checkout->issue_id } + } + ); + + is( ref($checkout->renewals), 'Koha::Checkouts::Renewals', 'Object set type is correct' ); + is( $checkout->renewals->count, 2, "Count of renewals is correct" ); + + $schema->storage->txn_rollback; +}; --