Lines 80-96
subtest 'Notifications on new issues - add_subscriber|remove_subscriber|subscrib
Link Here
|
80 |
}; |
80 |
}; |
81 |
|
81 |
|
82 |
subtest 'Koha::Subscription->vendor' => sub { |
82 |
subtest 'Koha::Subscription->vendor' => sub { |
83 |
plan tests => 2; |
83 |
plan tests => 3; |
84 |
my $vendor = $builder->build( { source => 'Aqbookseller' } ); |
84 |
my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); |
85 |
my $subscription = $builder->build( |
85 |
my $subscription = $builder->build_object( |
86 |
{ |
86 |
{ |
87 |
source => 'Subscription', |
87 |
class => 'Koha::Subscriptions', |
88 |
value => { aqbooksellerid => $vendor->{id} } |
88 |
value => { aqbooksellerid => $vendor->id } |
89 |
} |
89 |
} |
90 |
); |
90 |
); |
91 |
my $object = Koha::Subscriptions->find( $subscription->{subscriptionid} ); |
91 |
is( |
92 |
is( ref($object->vendor), 'Koha::Acquisition::Bookseller', 'Koha::Subscription->vendor should return a Koha::Acquisition::Bookseller' ); |
92 |
ref( $subscription->vendor ), 'Koha::Acquisition::Bookseller', |
93 |
is( $object->vendor->id, $subscription->{aqbooksellerid}, 'Koha::Subscription->vendor should return the correct vendor' ); |
93 |
'Koha::Subscription->vendor should return a Koha::Acquisition::Bookseller' |
|
|
94 |
); |
95 |
is( |
96 |
$subscription->vendor->id, $subscription->aqbooksellerid, |
97 |
'Koha::Subscription->vendor should return the correct vendor' |
98 |
); |
99 |
|
100 |
$vendor->delete(); |
101 |
$subscription->discard_changes; |
102 |
is( $subscription->vendor, undef, 'Koha::Subscription->vendor should return undef if the vendor is deleted' ); |
94 |
}; |
103 |
}; |
95 |
|
104 |
|
96 |
subtest 'Koha::Subscription->frequency' => sub { |
105 |
subtest 'Koha::Subscription->frequency' => sub { |
97 |
- |
|
|