|
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 83-89
my $subscriptionhistory = $builder->build({
Link Here
|
| 83 |
|
84 |
|
| 84 |
# Actual testing starts here! |
85 |
# Actual testing starts here! |
| 85 |
|
86 |
|
|
|
87 |
# Calculate the subscription length for the renewal for issues, days and months |
| 88 |
my ($numberlength, $weeklength, $monthlength) = getsublength('issues', 7); |
| 89 |
is ( $numberlength, 7, "Sub length is 7 issues"); |
| 90 |
|
| 91 |
($numberlength, $weeklength, $monthlength) = getsublength('weeks', 7); |
| 92 |
is ( $weeklength, 7, "Sub length is 7 weeks"); |
| 93 |
|
| 94 |
($numberlength, $weeklength, $monthlength) = getsublength('months', 7); |
| 95 |
is ( $monthlength, 7, "Sub length is 7 months"); |
| 96 |
|
| 86 |
# Renew the subscription and check that enddate has not been set |
97 |
# Renew the subscription and check that enddate has not been set |
|
|
98 |
|
| 87 |
ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,''); |
99 |
ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,''); |
| 88 |
my $history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); |
100 |
my $history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); |
| 89 |
|
101 |
|
| 90 |
- |
|
|