|
|
@ -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; |
|
|
|
}; |
|
|
|