|
Lines 3-8
Link Here
|
| 3 |
# This script includes tests for ReNewSubscription |
3 |
# This script includes tests for ReNewSubscription |
| 4 |
|
4 |
|
| 5 |
# Copyright 2015 BibLibre, Paul Poulain |
5 |
# Copyright 2015 BibLibre, Paul Poulain |
|
|
6 |
# Copyright 2018 Catalyst IT, Alex Buckley |
| 6 |
# |
7 |
# |
| 7 |
# This file is part of Koha. |
8 |
# This file is part of Koha. |
| 8 |
# |
9 |
# |
|
Lines 21-27
Link Here
|
| 21 |
|
22 |
|
| 22 |
use Modern::Perl; |
23 |
use Modern::Perl; |
| 23 |
|
24 |
|
| 24 |
use Test::More tests => 1; |
25 |
use Test::More tests => 4; |
| 25 |
use Test::MockModule; |
26 |
use Test::MockModule; |
| 26 |
use t::lib::TestBuilder; |
27 |
use t::lib::TestBuilder; |
| 27 |
use t::lib::Mocks; |
28 |
use t::lib::Mocks; |
|
Lines 93-98
ReNewSubscription(
Link Here
|
| 93 |
monthlength => 12 |
94 |
monthlength => 12 |
| 94 |
} |
95 |
} |
| 95 |
); |
96 |
); |
|
|
97 |
|
| 98 |
# Calculate the subscription length for the renewal for issues, days and months |
| 99 |
my ($numberlength, $weeklength, $monthlength) = getsublength('issues', 7); |
| 100 |
is ( $numberlength, 7, "Sub length is 7 issues"); |
| 101 |
|
| 102 |
($numberlength, $weeklength, $monthlength) = getsublength('weeks', 7); |
| 103 |
is ( $weeklength, 7, "Sub length is 7 weeks"); |
| 104 |
|
| 105 |
($numberlength, $weeklength, $monthlength) = getsublength('months', 7); |
| 106 |
is ( $monthlength, 7, "Sub length is 7 months"); |
| 107 |
|
| 108 |
# Renew the subscription and check that enddate has not been set |
| 109 |
|
| 110 |
ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,''); |
| 96 |
my $history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); |
111 |
my $history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); |
| 97 |
|
112 |
|
| 98 |
is ( $history->histenddate(), undef, 'subscription history not empty after renewal'); |
113 |
is ( $history->histenddate(), undef, 'subscription history not empty after renewal'); |
| 99 |
- |
|
|