Lines 372-384
$subscription = {
Link Here
|
372 |
}; |
372 |
}; |
373 |
$publisheddate = $subscription->{firstacquidate}; |
373 |
$publisheddate = $subscription->{firstacquidate}; |
374 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
374 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
375 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
375 |
is($publisheddate, '1970-01-16', 'Jan 16'); |
376 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
376 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
377 |
is($publisheddate, '1970-02-01'); |
377 |
is($publisheddate, '1970-02-01', 'Feb 1'); |
378 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
378 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
379 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
379 |
is($publisheddate, '1970-02-16', 'Feb 16'); |
380 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
380 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
381 |
is($publisheddate, '1970-03-01'); |
381 |
is($publisheddate, '1970-03-01', 'Mar 1' ); |
382 |
|
382 |
|
383 |
# TEST CASE - 2 issues per month, irregularities |
383 |
# TEST CASE - 2 issues per month, irregularities |
384 |
$subscription = { |
384 |
$subscription = { |
Lines 389-403
$subscription = {
Link Here
|
389 |
}; |
389 |
}; |
390 |
$publisheddate = $subscription->{firstacquidate}; |
390 |
$publisheddate = $subscription->{firstacquidate}; |
391 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
391 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
392 |
is($publisheddate, '1970-01-16', 'January has 31 days'); |
392 |
is($publisheddate, '1970-01-16', 'Jan 16' ); |
393 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
393 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
394 |
is($publisheddate, '1970-02-15', 'February has only 28 days'); |
394 |
is($publisheddate, '1970-02-16', 'Feb 16 (skipping Feb 1)' ); |
395 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
395 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
396 |
is($publisheddate, '1970-04-01'); |
396 |
is($publisheddate, '1970-04-01', 'Apr 1 (skipping Mar 1 and 16)' ); |
397 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
397 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
398 |
is($publisheddate, '1970-04-16', 'April has 30 days'); |
398 |
is($publisheddate, '1970-04-16', 'Apr 16' ); |
399 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
399 |
$publisheddate = GetNextDate($subscription, $publisheddate); |
400 |
is($publisheddate, '1970-05-01'); |
400 |
is($publisheddate, '1970-05-01', 'May 1' ); |
401 |
|
401 |
|
402 |
# TEST CASE - 1 issue per year, no irregularity |
402 |
# TEST CASE - 1 issue per year, no irregularity |
403 |
$id = AddSubscriptionFrequency({ |
403 |
$id = AddSubscriptionFrequency({ |
404 |
- |
|
|