Lines 18-541
my $frequency = {
Link Here
|
18 |
issuesperunit => 1, |
18 |
issuesperunit => 1, |
19 |
unitsperissue => 1, |
19 |
unitsperissue => 1, |
20 |
}; |
20 |
}; |
21 |
my $id = AddSubscriptionFrequency($frequency); |
|
|
22 |
|
21 |
|
23 |
my $subscription = { |
22 |
my $subscription = { |
24 |
periodicity => $id, |
|
|
25 |
firstacquidate => '1970-01-01', |
23 |
firstacquidate => '1970-01-01', |
26 |
irregularity => '', |
24 |
irregularity => '', |
27 |
countissuesperunit => 1, |
25 |
countissuesperunit => 1, |
28 |
}; |
26 |
}; |
29 |
my $publisheddate = $subscription->{firstacquidate}; |
27 |
my $publisheddate = $subscription->{firstacquidate}; |
30 |
|
28 |
|
31 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
29 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
32 |
is($publisheddate, '1970-01-02'); |
30 |
is($publisheddate, '1970-01-02'); |
33 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
31 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
34 |
is($publisheddate, '1970-01-03'); |
32 |
is($publisheddate, '1970-01-03'); |
35 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
33 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
36 |
is($publisheddate, '1970-01-04'); |
34 |
is($publisheddate, '1970-01-04'); |
37 |
|
35 |
|
38 |
# TEST CASE - 1 issue per day, irregularities |
36 |
# TEST CASE - 1 issue per day, irregularities |
39 |
$subscription = { |
37 |
$subscription = { |
40 |
periodicity => $id, |
|
|
41 |
firstacquidate => '1970-01-01', |
38 |
firstacquidate => '1970-01-01', |
42 |
irregularity => '2;4', # Skip the second and fourth issues |
39 |
irregularity => '2;4', # Skip the second and fourth issues |
43 |
countissuesperunit => 1, |
40 |
countissuesperunit => 1, |
44 |
}; |
41 |
}; |
45 |
$publisheddate = $subscription->{firstacquidate}; |
42 |
$publisheddate = $subscription->{firstacquidate}; |
46 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
43 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
47 |
is($publisheddate, '1970-01-03'); |
44 |
is($publisheddate, '1970-01-03'); |
48 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
45 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
49 |
is($publisheddate, '1970-01-05'); |
46 |
is($publisheddate, '1970-01-05'); |
50 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
47 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
51 |
is($publisheddate, '1970-01-06'); |
48 |
is($publisheddate, '1970-01-06'); |
52 |
|
49 |
|
53 |
# TEST CASE - 2 issues per day, no irregularity |
50 |
# TEST CASE - 2 issues per day, no irregularity |
54 |
$id = AddSubscriptionFrequency({ |
51 |
$frequency = { |
55 |
description => "Two issues per day", |
52 |
description => "Two issues per day", |
56 |
unit => 'day', |
53 |
unit => 'day', |
57 |
issuesperunit => 2, |
54 |
issuesperunit => 2, |
58 |
unitsperissue => 1, |
55 |
unitsperissue => 1, |
59 |
}); |
56 |
}; |
60 |
$subscription = { |
57 |
$subscription = { |
61 |
periodicity => $id, |
|
|
62 |
firstacquidate => '1970-01-01', |
58 |
firstacquidate => '1970-01-01', |
63 |
irregularity => '', |
59 |
irregularity => '', |
64 |
countissuesperunit => 1, |
60 |
countissuesperunit => 1, |
65 |
}; |
61 |
}; |
66 |
$publisheddate = $subscription->{firstacquidate}; |
62 |
$publisheddate = $subscription->{firstacquidate}; |
67 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
63 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
68 |
is($publisheddate, '1970-01-01'); |
64 |
is($publisheddate, '1970-01-01'); |
69 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
65 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
70 |
is($publisheddate, '1970-01-02'); |
66 |
is($publisheddate, '1970-01-02'); |
71 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
67 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
72 |
is($publisheddate, '1970-01-02'); |
68 |
is($publisheddate, '1970-01-02'); |
73 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
69 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
74 |
is($publisheddate, '1970-01-03'); |
70 |
is($publisheddate, '1970-01-03'); |
75 |
|
71 |
|
76 |
# TEST CASE - 2 issues per day, irregularities |
72 |
# TEST CASE - 2 issues per day, irregularities |
77 |
$subscription = { |
73 |
$subscription = { |
78 |
periodicity => $id, |
|
|
79 |
firstacquidate => '1970-01-01', |
74 |
firstacquidate => '1970-01-01', |
80 |
irregularity => '3;5;6', |
75 |
irregularity => '3;5;6', |
81 |
countissuesperunit => 1, |
76 |
countissuesperunit => 1, |
82 |
}; |
77 |
}; |
83 |
$publisheddate = $subscription->{firstacquidate}; |
78 |
$publisheddate = $subscription->{firstacquidate}; |
84 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
79 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
85 |
is($publisheddate, '1970-01-01'); |
80 |
is($publisheddate, '1970-01-01'); |
86 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
81 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
87 |
is($publisheddate, '1970-01-02'); |
82 |
is($publisheddate, '1970-01-02'); |
88 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
83 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
89 |
is($publisheddate, '1970-01-04'); |
84 |
is($publisheddate, '1970-01-04'); |
90 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
85 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
91 |
is($publisheddate, '1970-01-04'); |
86 |
is($publisheddate, '1970-01-04'); |
92 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
87 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
93 |
is($publisheddate, '1970-01-05'); |
88 |
is($publisheddate, '1970-01-05'); |
94 |
|
89 |
|
95 |
# TEST CASE - 1 issue every 2 days, no irregularity |
90 |
# TEST CASE - 1 issue every 2 days, no irregularity |
96 |
$id = AddSubscriptionFrequency({ |
91 |
$frequency = { |
97 |
description => "one issue every two days", |
92 |
description => "one issue every two days", |
98 |
unit => 'day', |
93 |
unit => 'day', |
99 |
issuesperunit => 1, |
94 |
issuesperunit => 1, |
100 |
unitsperissue => 2, |
95 |
unitsperissue => 2, |
101 |
}); |
96 |
}; |
102 |
$subscription = { |
97 |
$subscription = { |
103 |
periodicity => $id, |
|
|
104 |
firstacquidate => '1970-01-01', |
98 |
firstacquidate => '1970-01-01', |
105 |
irregularity => '', |
99 |
irregularity => '', |
106 |
countissuesperunit => 1, |
100 |
countissuesperunit => 1, |
107 |
}; |
101 |
}; |
108 |
$publisheddate = $subscription->{firstacquidate}; |
102 |
$publisheddate = $subscription->{firstacquidate}; |
109 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
103 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
110 |
is($publisheddate, '1970-01-03'); |
104 |
is($publisheddate, '1970-01-03'); |
111 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
105 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
112 |
is($publisheddate, '1970-01-05'); |
106 |
is($publisheddate, '1970-01-05'); |
113 |
|
107 |
|
114 |
# TEST CASE - 1 issue every 2 days, irregularities |
108 |
# TEST CASE - 1 issue every 2 days, irregularities |
115 |
$subscription = { |
109 |
$subscription = { |
116 |
periodicity => $id, |
|
|
117 |
firstacquidate => '1970-01-01', |
110 |
firstacquidate => '1970-01-01', |
118 |
irregularity => '3', |
111 |
irregularity => '3', |
119 |
countissuesperunit => 1, |
112 |
countissuesperunit => 1, |
120 |
}; |
113 |
}; |
121 |
$publisheddate = $subscription->{firstacquidate}; |
114 |
$publisheddate = $subscription->{firstacquidate}; |
122 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
115 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
123 |
is($publisheddate, '1970-01-03'); |
116 |
is($publisheddate, '1970-01-03'); |
124 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
117 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
125 |
is($publisheddate, '1970-01-07'); |
118 |
is($publisheddate, '1970-01-07'); |
126 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
119 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
127 |
is($publisheddate, '1970-01-09'); |
120 |
is($publisheddate, '1970-01-09'); |
128 |
|
121 |
|
129 |
# TEST CASE - 1 issue per week, no irregularity |
122 |
# TEST CASE - 1 issue per week, no irregularity |
130 |
$id = AddSubscriptionFrequency({ |
123 |
$frequency = { |
131 |
description => "one issue per week", |
124 |
description => "one issue per week", |
132 |
unit => 'week', |
125 |
unit => 'week', |
133 |
issuesperunit => 1, |
126 |
issuesperunit => 1, |
134 |
unitsperissue => 1, |
127 |
unitsperissue => 1, |
135 |
}); |
128 |
}; |
136 |
$subscription = { |
129 |
$subscription = { |
137 |
periodicity => $id, |
|
|
138 |
firstacquidate => '1970-01-01', |
130 |
firstacquidate => '1970-01-01', |
139 |
irregularity => '', |
131 |
irregularity => '', |
140 |
countissuesperunit => 1, |
132 |
countissuesperunit => 1, |
141 |
}; |
133 |
}; |
142 |
$publisheddate = $subscription->{firstacquidate}; |
134 |
$publisheddate = $subscription->{firstacquidate}; |
143 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
135 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
144 |
is($publisheddate, '1970-01-08'); |
136 |
is($publisheddate, '1970-01-08'); |
145 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
137 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
146 |
is($publisheddate, '1970-01-15'); |
138 |
is($publisheddate, '1970-01-15'); |
147 |
|
139 |
|
148 |
# TEST CASE - 1 issue per week, irregularities |
140 |
# TEST CASE - 1 issue per week, irregularities |
149 |
$subscription = { |
141 |
$subscription = { |
150 |
periodicity => $id, |
|
|
151 |
firstacquidate => '1970-01-01', |
142 |
firstacquidate => '1970-01-01', |
152 |
irregularity => '3', |
143 |
irregularity => '3', |
153 |
countissuesperunit => 1, |
144 |
countissuesperunit => 1, |
154 |
}; |
145 |
}; |
155 |
$publisheddate = $subscription->{firstacquidate}; |
146 |
$publisheddate = $subscription->{firstacquidate}; |
156 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
147 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
157 |
is($publisheddate, '1970-01-08'); |
148 |
is($publisheddate, '1970-01-08'); |
158 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
149 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
159 |
is($publisheddate, '1970-01-22'); |
150 |
is($publisheddate, '1970-01-22'); |
160 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
151 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
161 |
is($publisheddate, '1970-01-29'); |
152 |
is($publisheddate, '1970-01-29'); |
162 |
|
153 |
|
163 |
# TEST CASE - 1 issue every 2 weeks, no irregularity |
154 |
# TEST CASE - 1 issue every 2 weeks, no irregularity |
164 |
$id = AddSubscriptionFrequency({ |
155 |
$frequency = { |
165 |
description => "one issue every 2 weeks", |
156 |
description => "one issue every 2 weeks", |
166 |
unit => 'week', |
157 |
unit => 'week', |
167 |
issuesperunit => 1, |
158 |
issuesperunit => 1, |
168 |
unitsperissue => 2, |
159 |
unitsperissue => 2, |
169 |
}); |
160 |
}; |
170 |
$subscription = { |
161 |
$subscription = { |
171 |
periodicity => $id, |
|
|
172 |
firstacquidate => '1970-01-01', |
162 |
firstacquidate => '1970-01-01', |
173 |
irregularity => '', |
163 |
irregularity => '', |
174 |
countissuesperunit => 1, |
164 |
countissuesperunit => 1, |
175 |
}; |
165 |
}; |
176 |
$publisheddate = $subscription->{firstacquidate}; |
166 |
$publisheddate = $subscription->{firstacquidate}; |
177 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
167 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
178 |
is($publisheddate, '1970-01-15'); |
168 |
is($publisheddate, '1970-01-15'); |
179 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
169 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
180 |
is($publisheddate, '1970-01-29'); |
170 |
is($publisheddate, '1970-01-29'); |
181 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
171 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
182 |
is($publisheddate, '1970-02-12'); |
172 |
is($publisheddate, '1970-02-12'); |
183 |
|
173 |
|
184 |
# TEST CASE - 1 issue every 2 weeks, irregularities |
174 |
# TEST CASE - 1 issue every 2 weeks, irregularities |
185 |
$subscription = { |
175 |
$subscription = { |
186 |
periodicity => $id, |
|
|
187 |
firstacquidate => '1970-01-01', |
176 |
firstacquidate => '1970-01-01', |
188 |
irregularity => '3', |
177 |
irregularity => '3', |
189 |
countissuesperunit => 1, |
178 |
countissuesperunit => 1, |
190 |
}; |
179 |
}; |
191 |
$publisheddate = $subscription->{firstacquidate}; |
180 |
$publisheddate = $subscription->{firstacquidate}; |
192 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
181 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
193 |
is($publisheddate, '1970-01-15'); |
182 |
is($publisheddate, '1970-01-15'); |
194 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
183 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
195 |
is($publisheddate, '1970-02-12'); |
184 |
is($publisheddate, '1970-02-12'); |
196 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
185 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
197 |
is($publisheddate, '1970-02-26'); |
186 |
is($publisheddate, '1970-02-26'); |
198 |
|
187 |
|
199 |
# TEST CASE - 2 issues per week, no irregularity |
188 |
# TEST CASE - 2 issues per week, no irregularity |
200 |
$id = AddSubscriptionFrequency({ |
189 |
$frequency = { |
201 |
description => "two issues per week", |
190 |
description => "two issues per week", |
202 |
unit => 'week', |
191 |
unit => 'week', |
203 |
issuesperunit => 2, |
192 |
issuesperunit => 2, |
204 |
unitsperissue => 1, |
193 |
unitsperissue => 1, |
205 |
}); |
194 |
}; |
206 |
$subscription = { |
195 |
$subscription = { |
207 |
periodicity => $id, |
|
|
208 |
firstacquidate => '1970-01-01', |
196 |
firstacquidate => '1970-01-01', |
209 |
irregularity => '', |
197 |
irregularity => '', |
210 |
countissuesperunit => 1, |
198 |
countissuesperunit => 1, |
211 |
}; |
199 |
}; |
212 |
$publisheddate = $subscription->{firstacquidate}; |
200 |
$publisheddate = $subscription->{firstacquidate}; |
213 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
201 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
214 |
is($publisheddate, '1970-01-03'); |
202 |
is($publisheddate, '1970-01-03'); |
215 |
# when more than 1 issue per week, date is automatically set to the same day of |
203 |
# when more than 1 issue per week, date is automatically set to the same day of |
216 |
# week as firstacquidate |
204 |
# week as firstacquidate |
217 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
205 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
218 |
is($publisheddate, '1970-01-08'); |
206 |
is($publisheddate, '1970-01-08'); |
219 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
207 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
220 |
is($publisheddate, '1970-01-10'); |
208 |
is($publisheddate, '1970-01-10'); |
221 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
209 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
222 |
is($publisheddate, '1970-01-15'); |
210 |
is($publisheddate, '1970-01-15'); |
223 |
|
211 |
|
224 |
# TEST CASE - 2 issues per week, irregularities |
212 |
# TEST CASE - 2 issues per week, irregularities |
225 |
$subscription = { |
213 |
$subscription = { |
226 |
periodicity => $id, |
|
|
227 |
firstacquidate => '1970-01-01', |
214 |
firstacquidate => '1970-01-01', |
228 |
irregularity => '3;5;6', |
215 |
irregularity => '3;5;6', |
229 |
countissuesperunit => 1, |
216 |
countissuesperunit => 1, |
230 |
}; |
217 |
}; |
231 |
$publisheddate = $subscription->{firstacquidate}; |
218 |
$publisheddate = $subscription->{firstacquidate}; |
232 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
219 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
233 |
is($publisheddate, '1970-01-03'); |
220 |
is($publisheddate, '1970-01-03'); |
234 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
221 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
235 |
is($publisheddate, '1970-01-10'); |
222 |
is($publisheddate, '1970-01-10'); |
236 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
223 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
237 |
is($publisheddate, '1970-01-22'); |
224 |
is($publisheddate, '1970-01-22'); |
238 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
225 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
239 |
is($publisheddate, '1970-01-24'); |
226 |
is($publisheddate, '1970-01-24'); |
240 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
227 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
241 |
is($publisheddate, '1970-01-29'); |
228 |
is($publisheddate, '1970-01-29'); |
242 |
|
229 |
|
243 |
# TEST CASE - 6 issues per week, no irregularity |
230 |
# TEST CASE - 6 issues per week, no irregularity |
244 |
$id = AddSubscriptionFrequency({ |
231 |
$frequency = { |
245 |
description => "six issues per week", |
232 |
description => "six issues per week", |
246 |
unit => 'week', |
233 |
unit => 'week', |
247 |
issuesperunit => 6, |
234 |
issuesperunit => 6, |
248 |
unitsperissue => 1, |
235 |
unitsperissue => 1, |
249 |
}); |
236 |
}; |
250 |
$subscription = { |
237 |
$subscription = { |
251 |
periodicity => $id, |
|
|
252 |
firstacquidate => '1970-01-06', |
238 |
firstacquidate => '1970-01-06', |
253 |
irregularity => '', |
239 |
irregularity => '', |
254 |
countissuesperunit => 1, |
240 |
countissuesperunit => 1, |
255 |
}; |
241 |
}; |
256 |
$publisheddate = $subscription->{firstacquidate}; |
242 |
$publisheddate = $subscription->{firstacquidate}; |
257 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
243 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
258 |
is($publisheddate, '1970-01-07'); |
244 |
is($publisheddate, '1970-01-07'); |
259 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
245 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
260 |
is($publisheddate, '1970-01-08'); |
246 |
is($publisheddate, '1970-01-08'); |
261 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
247 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
262 |
is($publisheddate, '1970-01-09'); |
248 |
is($publisheddate, '1970-01-09'); |
263 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
249 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
264 |
is($publisheddate, '1970-01-10'); |
250 |
is($publisheddate, '1970-01-10'); |
265 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
251 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
266 |
is($publisheddate, '1970-01-11'); |
252 |
is($publisheddate, '1970-01-11'); |
267 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
253 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
268 |
is($publisheddate, '1970-01-13'); |
254 |
is($publisheddate, '1970-01-13'); |
269 |
|
255 |
|
270 |
# TEST CASE - 6 issues per week, irregularities |
256 |
# TEST CASE - 6 issues per week, irregularities |
271 |
$subscription = { |
257 |
$subscription = { |
272 |
periodicity => $id, |
|
|
273 |
firstacquidate => '1970-01-06', |
258 |
firstacquidate => '1970-01-06', |
274 |
irregularity => '3;5;6', |
259 |
irregularity => '3;5;6', |
275 |
countissuesperunit => 1, |
260 |
countissuesperunit => 1, |
276 |
}; |
261 |
}; |
277 |
$publisheddate = $subscription->{firstacquidate}; |
262 |
$publisheddate = $subscription->{firstacquidate}; |
278 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
263 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
279 |
is($publisheddate, '1970-01-07'); |
264 |
is($publisheddate, '1970-01-07'); |
280 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
265 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
281 |
is($publisheddate, '1970-01-09'); |
266 |
is($publisheddate, '1970-01-09'); |
282 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
267 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
283 |
is($publisheddate, '1970-01-13'); |
268 |
is($publisheddate, '1970-01-13'); |
284 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
269 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
285 |
is($publisheddate, '1970-01-14'); |
270 |
is($publisheddate, '1970-01-14'); |
286 |
|
271 |
|
287 |
# TEST CASE - 1 issue per month, no irregularity |
272 |
# TEST CASE - 1 issue per month, no irregularity |
288 |
$id = AddSubscriptionFrequency({ |
273 |
$frequency = { |
289 |
description => "1 issue per month", |
274 |
description => "1 issue per month", |
290 |
unit => 'month', |
275 |
unit => 'month', |
291 |
issuesperunit => 1, |
276 |
issuesperunit => 1, |
292 |
unitsperissue => 1, |
277 |
unitsperissue => 1, |
293 |
}); |
278 |
}; |
294 |
$subscription = { |
279 |
$subscription = { |
295 |
periodicity => $id, |
|
|
296 |
firstacquidate => '1970-01-01', |
280 |
firstacquidate => '1970-01-01', |
297 |
irregularity => '', |
281 |
irregularity => '', |
298 |
countissuesperunit => 1, |
282 |
countissuesperunit => 1, |
299 |
}; |
283 |
}; |
300 |
$publisheddate = $subscription->{firstacquidate}; |
284 |
$publisheddate = $subscription->{firstacquidate}; |
301 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
285 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
302 |
is($publisheddate, '1970-02-01'); |
286 |
is($publisheddate, '1970-02-01'); |
303 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
287 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
304 |
is($publisheddate, '1970-03-01'); |
288 |
is($publisheddate, '1970-03-01'); |
305 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
289 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
306 |
is($publisheddate, '1970-04-01'); |
290 |
is($publisheddate, '1970-04-01'); |
307 |
|
291 |
|
308 |
# TEST CASE - 1 issue per month, irregularities |
292 |
# TEST CASE - 1 issue per month, irregularities |
309 |
$subscription = { |
293 |
$subscription = { |
310 |
periodicity => $id, |
|
|
311 |
firstacquidate => '1970-01-01', |
294 |
firstacquidate => '1970-01-01', |
312 |
irregularity => '2;4', |
295 |
irregularity => '2;4', |
313 |
countissuesperunit => 1, |
296 |
countissuesperunit => 1, |
314 |
}; |
297 |
}; |
315 |
$publisheddate = $subscription->{firstacquidate}; |
298 |
$publisheddate = $subscription->{firstacquidate}; |
316 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
299 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
317 |
is($publisheddate, '1970-03-01'); |
300 |
is($publisheddate, '1970-03-01'); |
318 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
301 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
319 |
is($publisheddate, '1970-05-01'); |
302 |
is($publisheddate, '1970-05-01'); |
320 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
303 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
321 |
is($publisheddate, '1970-06-01'); |
304 |
is($publisheddate, '1970-06-01'); |
322 |
|
305 |
|
323 |
# TEST CASE - 1 issue every 2 months, no irregularity |
306 |
# TEST CASE - 1 issue every 2 months, no irregularity |
324 |
$id = AddSubscriptionFrequency({ |
307 |
$frequency = { |
325 |
description => "1 issue every 2 months", |
308 |
description => "1 issue every 2 months", |
326 |
unit => 'month', |
309 |
unit => 'month', |
327 |
issuesperunit => 1, |
310 |
issuesperunit => 1, |
328 |
unitsperissue => 2, |
311 |
unitsperissue => 2, |
329 |
}); |
312 |
}; |
330 |
$subscription = { |
313 |
$subscription = { |
331 |
periodicity => $id, |
|
|
332 |
firstacquidate => '1970-01-01', |
314 |
firstacquidate => '1970-01-01', |
333 |
irregularity => '', |
315 |
irregularity => '', |
334 |
countissuesperunit => 1, |
316 |
countissuesperunit => 1, |
335 |
}; |
317 |
}; |
336 |
$publisheddate = $subscription->{firstacquidate}; |
318 |
$publisheddate = $subscription->{firstacquidate}; |
337 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
319 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
338 |
is($publisheddate, '1970-03-01'); |
320 |
is($publisheddate, '1970-03-01'); |
339 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
321 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
340 |
is($publisheddate, '1970-05-01'); |
322 |
is($publisheddate, '1970-05-01'); |
341 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
323 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
342 |
is($publisheddate, '1970-07-01'); |
324 |
is($publisheddate, '1970-07-01'); |
343 |
|
325 |
|
344 |
# TEST CASE - 1 issue every 2 months, irregularities |
326 |
# TEST CASE - 1 issue every 2 months, irregularities |
345 |
$subscription = { |
327 |
$subscription = { |
346 |
periodicity => $id, |
|
|
347 |
firstacquidate => '1970-01-01', |
328 |
firstacquidate => '1970-01-01', |
348 |
irregularity => '2;3', |
329 |
irregularity => '2;3', |
349 |
countissuesperunit => 1, |
330 |
countissuesperunit => 1, |
350 |
}; |
331 |
}; |
351 |
$publisheddate = $subscription->{firstacquidate}; |
332 |
$publisheddate = $subscription->{firstacquidate}; |
352 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
333 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
353 |
is($publisheddate, '1970-07-01'); |
334 |
is($publisheddate, '1970-07-01'); |
354 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
335 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
355 |
is($publisheddate, '1970-09-01'); |
336 |
is($publisheddate, '1970-09-01'); |
356 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
337 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
357 |
is($publisheddate, '1970-11-01'); |
338 |
is($publisheddate, '1970-11-01'); |
358 |
|
339 |
|
359 |
# TEST CASE - 2 issues per month, no irregularity |
340 |
# TEST CASE - 2 issues per month, no irregularity |
360 |
$id = AddSubscriptionFrequency({ |
341 |
$frequency = { |
361 |
description => "2 issues per month", |
342 |
description => "2 issues per month", |
362 |
unit => 'month', |
343 |
unit => 'month', |
363 |
issuesperunit => 2, |
344 |
issuesperunit => 2, |
364 |
unitsperissue => 1, |
345 |
unitsperissue => 1, |
365 |
}); |
346 |
}; |
366 |
$subscription = { |
347 |
$subscription = { |
367 |
periodicity => $id, |
|
|
368 |
firstacquidate => '1970-01-01', |
348 |
firstacquidate => '1970-01-01', |
369 |
irregularity => '', |
349 |
irregularity => '', |
370 |
countissuesperunit => 1, |
350 |
countissuesperunit => 1, |
371 |
}; |
351 |
}; |
372 |
$publisheddate = $subscription->{firstacquidate}; |
352 |
$publisheddate = $subscription->{firstacquidate}; |
373 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
353 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
374 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
354 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
375 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
355 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
376 |
is($publisheddate, '1970-02-01'); |
356 |
is($publisheddate, '1970-02-01'); |
377 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
357 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
378 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
358 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
379 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
359 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
380 |
is($publisheddate, '1970-03-01'); |
360 |
is($publisheddate, '1970-03-01'); |
381 |
|
361 |
|
382 |
# TEST CASE - 2 issues per month, irregularities |
362 |
# TEST CASE - 2 issues per month, irregularities |
383 |
$subscription = { |
363 |
$subscription = { |
384 |
periodicity => $id, |
|
|
385 |
firstacquidate => '1970-01-01', |
364 |
firstacquidate => '1970-01-01', |
386 |
irregularity => '3;5;6', |
365 |
irregularity => '3;5;6', |
387 |
countissuesperunit => 1, |
366 |
countissuesperunit => 1, |
388 |
}; |
367 |
}; |
389 |
$publisheddate = $subscription->{firstacquidate}; |
368 |
$publisheddate = $subscription->{firstacquidate}; |
390 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
369 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
391 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
370 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
392 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
371 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
393 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
372 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
394 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
373 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
395 |
is($publisheddate, '1970-04-01'); |
374 |
is($publisheddate, '1970-04-01'); |
396 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
375 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
397 |
is($publisheddate, '1970-04-16', 'April has 30 days'); |
376 |
is($publisheddate, '1970-04-16', 'April has 30 days'); |
398 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
377 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
399 |
is($publisheddate, '1970-05-01'); |
378 |
is($publisheddate, '1970-05-01'); |
400 |
|
379 |
|
401 |
# TEST CASE - 1 issue per year, no irregularity |
380 |
# TEST CASE - 1 issue per year, no irregularity |
402 |
$id = AddSubscriptionFrequency({ |
381 |
$frequency = { |
403 |
description => "1 issue per year", |
382 |
description => "1 issue per year", |
404 |
unit => 'year', |
383 |
unit => 'year', |
405 |
issuesperunit => 1, |
384 |
issuesperunit => 1, |
406 |
unitsperissue => 1, |
385 |
unitsperissue => 1, |
407 |
}); |
386 |
}; |
408 |
$subscription = { |
387 |
$subscription = { |
409 |
periodicity => $id, |
|
|
410 |
firstacquidate => '1970-01-01', |
388 |
firstacquidate => '1970-01-01', |
411 |
irregularity => '', |
389 |
irregularity => '', |
412 |
countissuesperunit => 1, |
390 |
countissuesperunit => 1, |
413 |
}; |
391 |
}; |
414 |
$publisheddate = $subscription->{firstacquidate}; |
392 |
$publisheddate = $subscription->{firstacquidate}; |
415 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
393 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
416 |
is($publisheddate, '1971-01-01'); |
394 |
is($publisheddate, '1971-01-01'); |
417 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
395 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
418 |
is($publisheddate, '1972-01-01'); |
396 |
is($publisheddate, '1972-01-01'); |
419 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
397 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
420 |
is($publisheddate, '1973-01-01'); |
398 |
is($publisheddate, '1973-01-01'); |
421 |
|
399 |
|
422 |
# TEST CASE - 1 issue per year, irregularities |
400 |
# TEST CASE - 1 issue per year, irregularities |
423 |
$subscription = { |
401 |
$subscription = { |
424 |
periodicity => $id, |
|
|
425 |
firstacquidate => '1970-01-01', |
402 |
firstacquidate => '1970-01-01', |
426 |
irregularity => '2;4', |
403 |
irregularity => '2;4', |
427 |
countissuesperunit => 1, |
404 |
countissuesperunit => 1, |
428 |
}; |
405 |
}; |
429 |
$publisheddate = $subscription->{firstacquidate}; |
406 |
$publisheddate = $subscription->{firstacquidate}; |
430 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
407 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
431 |
is($publisheddate, '1972-01-01'); |
408 |
is($publisheddate, '1972-01-01'); |
432 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
409 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
433 |
is($publisheddate, '1974-01-01'); |
410 |
is($publisheddate, '1974-01-01'); |
434 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
411 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
435 |
is($publisheddate, '1975-01-01'); |
412 |
is($publisheddate, '1975-01-01'); |
436 |
|
413 |
|
437 |
# TEST CASE - 1 issue every 2 years, no irregularity |
414 |
# TEST CASE - 1 issue every 2 years, no irregularity |
438 |
$id = AddSubscriptionFrequency({ |
415 |
$frequency = { |
439 |
description => "1 issue every 2 years", |
416 |
description => "1 issue every 2 years", |
440 |
unit => 'year', |
417 |
unit => 'year', |
441 |
issuesperunit => 1, |
418 |
issuesperunit => 1, |
442 |
unitsperissue => 2, |
419 |
unitsperissue => 2, |
443 |
}); |
420 |
}; |
444 |
$subscription = { |
421 |
$subscription = { |
445 |
periodicity => $id, |
|
|
446 |
firstacquidate => '1970-01-01', |
422 |
firstacquidate => '1970-01-01', |
447 |
irregularity => '', |
423 |
irregularity => '', |
448 |
countissuesperunit => 1, |
424 |
countissuesperunit => 1, |
449 |
}; |
425 |
}; |
450 |
$publisheddate = $subscription->{firstacquidate}; |
426 |
$publisheddate = $subscription->{firstacquidate}; |
451 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
427 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
452 |
is($publisheddate, '1972-01-01'); |
428 |
is($publisheddate, '1972-01-01'); |
453 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
429 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
454 |
is($publisheddate, '1974-01-01'); |
430 |
is($publisheddate, '1974-01-01'); |
455 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
431 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
456 |
is($publisheddate, '1976-01-01'); |
432 |
is($publisheddate, '1976-01-01'); |
457 |
|
433 |
|
458 |
# TEST CASE - 1 issue every 2 years, irregularities |
434 |
# TEST CASE - 1 issue every 2 years, irregularities |
459 |
$subscription = { |
435 |
$subscription = { |
460 |
periodicity => $id, |
|
|
461 |
firstacquidate => '1970-01-01', |
436 |
firstacquidate => '1970-01-01', |
462 |
irregularity => '2;4', |
437 |
irregularity => '2;4', |
463 |
countissuesperunit => 1, |
438 |
countissuesperunit => 1, |
464 |
}; |
439 |
}; |
465 |
$publisheddate = $subscription->{firstacquidate}; |
440 |
$publisheddate = $subscription->{firstacquidate}; |
466 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
441 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
467 |
is($publisheddate, '1974-01-01'); |
442 |
is($publisheddate, '1974-01-01'); |
468 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
443 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
469 |
is($publisheddate, '1978-01-01'); |
444 |
is($publisheddate, '1978-01-01'); |
470 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
445 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
471 |
is($publisheddate, '1980-01-01'); |
446 |
is($publisheddate, '1980-01-01'); |
472 |
|
447 |
|
473 |
# TEST CASE - 2 issues per year, no irregularity |
448 |
# TEST CASE - 2 issues per year, no irregularity |
474 |
$id = AddSubscriptionFrequency({ |
449 |
$frequency = { |
475 |
description => "1 issue every 2 years", |
450 |
description => "1 issue every 2 years", |
476 |
unit => 'year', |
451 |
unit => 'year', |
477 |
issuesperunit => 2, |
452 |
issuesperunit => 2, |
478 |
unitsperissue => 1, |
453 |
unitsperissue => 1, |
479 |
}); |
454 |
}; |
480 |
$subscription = { |
455 |
$subscription = { |
481 |
periodicity => $id, |
|
|
482 |
firstacquidate => '1970-01-01', |
456 |
firstacquidate => '1970-01-01', |
483 |
irregularity => '', |
457 |
irregularity => '', |
484 |
countissuesperunit => 1, |
458 |
countissuesperunit => 1, |
485 |
}; |
459 |
}; |
486 |
$publisheddate = $subscription->{firstacquidate}; |
460 |
$publisheddate = $subscription->{firstacquidate}; |
487 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
461 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
488 |
is($publisheddate, '1970-07-02'); |
462 |
is($publisheddate, '1970-07-02'); |
489 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
463 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
490 |
is($publisheddate, '1971-01-01'); |
464 |
is($publisheddate, '1971-01-01'); |
491 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
465 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
492 |
is($publisheddate, '1971-07-02'); |
466 |
is($publisheddate, '1971-07-02'); |
493 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
467 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
494 |
is($publisheddate, '1972-01-01'); |
468 |
is($publisheddate, '1972-01-01'); |
495 |
|
469 |
|
496 |
# TEST CASE - 2 issues per year, irregularities |
470 |
# TEST CASE - 2 issues per year, irregularities |
497 |
$subscription = { |
471 |
$subscription = { |
498 |
periodicity => $id, |
|
|
499 |
firstacquidate => '1970-01-01', |
472 |
firstacquidate => '1970-01-01', |
500 |
irregularity => '3;5;6', |
473 |
irregularity => '3;5;6', |
501 |
countissuesperunit => 1, |
474 |
countissuesperunit => 1, |
502 |
}; |
475 |
}; |
503 |
$publisheddate = $subscription->{firstacquidate}; |
476 |
$publisheddate = $subscription->{firstacquidate}; |
504 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
477 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
505 |
is($publisheddate, '1970-07-02'); |
478 |
is($publisheddate, '1970-07-02'); |
506 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
479 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
507 |
is($publisheddate, '1971-07-02'); |
480 |
is($publisheddate, '1971-07-02'); |
508 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
481 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
509 |
is($publisheddate, '1973-01-01'); |
482 |
is($publisheddate, '1973-01-01'); |
510 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
483 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
511 |
is($publisheddate, '1973-07-02'); |
484 |
is($publisheddate, '1973-07-02'); |
512 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
485 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
513 |
is($publisheddate, '1974-01-01'); |
486 |
is($publisheddate, '1974-01-01'); |
514 |
|
487 |
|
515 |
# TEST CASE - Irregular |
488 |
# TEST CASE - Irregular |
516 |
$id = AddSubscriptionFrequency({ |
489 |
$frequency = { |
517 |
description => "Irregular", |
490 |
description => "Irregular", |
518 |
unit => undef, |
491 |
unit => undef, |
519 |
issuesperunit => 1, |
492 |
issuesperunit => 1, |
520 |
unitsperissue => 1, |
493 |
unitsperissue => 1, |
521 |
}); |
494 |
}; |
522 |
$subscription = { |
495 |
$subscription = { |
523 |
periodicity => $id, |
|
|
524 |
firstacquidate => '1970-01-01', |
496 |
firstacquidate => '1970-01-01', |
525 |
irregularity => '', |
497 |
irregularity => '', |
526 |
countissuesperunit => 1, |
498 |
countissuesperunit => 1, |
527 |
}; |
499 |
}; |
528 |
$publisheddate = $subscription->{firstacquidate}; |
500 |
$publisheddate = $subscription->{firstacquidate}; |
529 |
# GetNextDate always return undef if subscription is irregular |
501 |
# GetNextDate always return undef if subscription is irregular |
530 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
502 |
$publisheddate = GetNextDate($subscription, $publisheddate, $frequency); |
531 |
is($publisheddate, undef); |
503 |
is($publisheddate, undef); |
532 |
|
504 |
|
533 |
# GetNextDate returns undef if one of two first parameters is undef |
505 |
# GetNextDate returns undef if one of two first parameters is undef |
534 |
$publisheddate = GetNextDate($subscription, undef); |
506 |
$publisheddate = GetNextDate($subscription, undef, $frequency); |
535 |
is($publisheddate, undef); |
507 |
is($publisheddate, undef); |
536 |
$publisheddate = GetNextDate(undef, $subscription->{firstacquidate}); |
508 |
$publisheddate = GetNextDate(undef, $subscription->{firstacquidate}, $frequency); |
537 |
is($publisheddate, undef); |
509 |
is($publisheddate, undef); |
538 |
$publisheddate = GetNextDate(undef, undef); |
510 |
$publisheddate = GetNextDate(undef, undef, $frequency); |
539 |
is($publisheddate, undef); |
511 |
is($publisheddate, undef); |
540 |
|
512 |
|
541 |
$dbh->rollback; |
513 |
$dbh->rollback; |