|
Lines 19-30
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 |
|
23 |
|
| 24 |
use C4::Reserves; |
24 |
use C4::Reserves; |
| 25 |
|
25 |
|
| 26 |
use Koha::Biblios; |
26 |
use Koha::Biblios; |
| 27 |
use Koha::Patrons; |
27 |
use Koha::Patrons; |
|
|
28 |
use Koha::Subscriptions; |
| 28 |
use t::lib::TestBuilder; |
29 |
use t::lib::TestBuilder; |
| 29 |
use t::lib::Mocks; |
30 |
use t::lib::Mocks; |
| 30 |
|
31 |
|
|
Lines 52-57
subtest 'holds' => sub {
Link Here
|
| 52 |
is( $holds->next->borrowernumber, $patron->borrowernumber, '->holds should return the correct hold' ); |
53 |
is( $holds->next->borrowernumber, $patron->borrowernumber, '->holds should return the correct hold' ); |
| 53 |
}; |
54 |
}; |
| 54 |
|
55 |
|
|
|
56 |
subtest 'subscriptions' => sub { |
| 57 |
plan tests => 2; |
| 58 |
$builder->build( |
| 59 |
{ source => 'Subscription', value => { biblionumber => $biblio->id } } |
| 60 |
); |
| 61 |
$builder->build( |
| 62 |
{ source => 'Subscription', value => { biblionumber => $biblio->id } } |
| 63 |
); |
| 64 |
my $biblio = Koha::Biblios->find( $biblio->id ); |
| 65 |
my $subscriptions = $biblio->subscriptions; |
| 66 |
is( ref($subscriptions), 'Koha::Subscriptions', |
| 67 |
'Koha::Biblio->subscriptions should return a Koha::Subscriptions object' |
| 68 |
); |
| 69 |
is( $subscriptions->count, 2, 'Koha::Biblio->subscriptions should return the correct number of subscriptions'); |
| 70 |
}; |
| 71 |
|
| 55 |
$schema->storage->txn_rollback; |
72 |
$schema->storage->txn_rollback; |
| 56 |
|
73 |
|
| 57 |
1; |
74 |
1; |
| 58 |
- |
|
|