Lines 16-22
use Koha::DateUtils qw( dt_from_string output_pref );
Link Here
|
16 |
use Koha::Acquisition::Booksellers; |
16 |
use Koha::Acquisition::Booksellers; |
17 |
use t::lib::Mocks; |
17 |
use t::lib::Mocks; |
18 |
use t::lib::TestBuilder; |
18 |
use t::lib::TestBuilder; |
19 |
use Test::More tests => 54; |
19 |
use Test::More tests => 56; |
20 |
|
20 |
|
21 |
BEGIN { |
21 |
BEGIN { |
22 |
use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); |
22 |
use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); |
Lines 194-199
is(
Link Here
|
194 |
'SearchSubscriptions returned only one subscription when results_limit is set to "1"' |
194 |
'SearchSubscriptions returned only one subscription when results_limit is set to "1"' |
195 |
); |
195 |
); |
196 |
|
196 |
|
|
|
197 |
# Set up fake data |
198 |
my $subscriptionwithroutinglistid = NewSubscription( |
199 |
undef, "", undef, undef, $budget_id, $biblionumber, |
200 |
'2013-01-01', $frequency_id, undef, undef, undef, |
201 |
undef, undef, undef, undef, undef, undef, |
202 |
1, $notes, undef, '2013-01-01', undef, $pattern_id, |
203 |
undef, undef, 0, $internalnotes, 0, |
204 |
undef, undef, 0, undef, '2013-12-31', 0 |
205 |
); |
206 |
|
207 |
#creating fake patrons |
208 |
my $patron = $builder->build_object( |
209 |
{ |
210 |
class => 'Koha::Patrons', |
211 |
} |
212 |
); |
213 |
my $patron2 = $builder->build_object( |
214 |
{ |
215 |
class => 'Koha::Patrons', |
216 |
} |
217 |
); |
218 |
my $patronid1 = $patron->borrowernumber; |
219 |
my $patronid2 = $patron2->borrowernumber; |
220 |
|
221 |
# Add a fake routing list with fake patrons |
222 |
addroutingmember( $patronid1, $subscriptionwithroutinglistid ); |
223 |
addroutingmember( $patronid2, $subscriptionwithroutinglistid ); |
224 |
|
225 |
# Perform SearchSubscriptions |
226 |
my $fake_subscription = GetSubscription($subscriptionwithroutinglistid); |
227 |
|
228 |
my @subscriptionswithroutinglist = SearchSubscriptions( |
229 |
{ |
230 |
issn => $fake_subscription->{issn}, |
231 |
orderby => 'title', |
232 |
routinglist => 1 |
233 |
} |
234 |
); |
235 |
|
236 |
# Check the results |
237 |
is( @subscriptionswithroutinglist, 1, 'SearchSubscriptions returned the expected number of subscriptions' ); |
238 |
is( |
239 |
$subscriptionswithroutinglist[0]->{title}, $fake_subscription->{title}, |
240 |
'SearchSubscriptions returned the correct subscription' |
241 |
); |
242 |
|
197 |
my $frequency = GetSubscriptionFrequency($subscriptioninformation->{periodicity}); |
243 |
my $frequency = GetSubscriptionFrequency($subscriptioninformation->{periodicity}); |
198 |
my $old_frequency; |
244 |
my $old_frequency; |
199 |
if (not $frequency->{unit}) { |
245 |
if (not $frequency->{unit}) { |
200 |
- |
|
|