|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 1; |
22 |
use Test::More tests => 2; |
| 23 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
| 24 |
|
24 |
|
| 25 |
use Koha::Database; |
25 |
use Koha::Database; |
|
Lines 48-50
subtest 'library() tests' => sub {
Link Here
|
| 48 |
|
48 |
|
| 49 |
$schema->storage->txn_rollback; |
49 |
$schema->storage->txn_rollback; |
| 50 |
}; |
50 |
}; |
| 51 |
- |
51 |
|
|
|
52 |
subtest 'renewals() tests' => sub { |
| 53 |
|
| 54 |
plan tests => 2; |
| 55 |
$schema->storage->txn_begin; |
| 56 |
|
| 57 |
my $checkout = $builder->build_object( |
| 58 |
{ |
| 59 |
class => 'Koha::Checkouts' |
| 60 |
} |
| 61 |
); |
| 62 |
my $renewal1 = $builder->build_object( |
| 63 |
{ |
| 64 |
class => 'Koha::Checkouts::Renewals', |
| 65 |
value => { checkout_id => $checkout->issue_id } |
| 66 |
} |
| 67 |
); |
| 68 |
my $renewal2 = $builder->build_object( |
| 69 |
{ |
| 70 |
class => 'Koha::Checkouts::Renewals', |
| 71 |
value => { checkout_id => $checkout->issue_id } |
| 72 |
} |
| 73 |
); |
| 74 |
|
| 75 |
is( ref($checkout->renewals), 'Koha::Checkouts::Renewals', 'Object set type is correct' ); |
| 76 |
is( $checkout->renewals->count, 2, "Count of renewals is correct" ); |
| 77 |
|
| 78 |
$schema->storage->txn_rollback; |
| 79 |
}; |