Bugzilla – Attachment 64028 Details for
Bug 18697
Fix date calculations for day/week frequencies in Serials
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18697: Adjusting unit tests for dayly serial frequencies
SIGNED-OFF-Bug-18697-Adjusting-unit-tests-for-dayl.patch (text/plain), 2.67 KB, created by
Josef Moravec
on 2017-06-06 07:52:36 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18697: Adjusting unit tests for dayly serial frequencies
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-06-06 07:52:36 UTC
Size:
2.67 KB
patch
obsolete
>From fee9f9590aaad20fb08162a276d0e0a0f3b5e2bc Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 31 May 2017 15:20:40 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 18697: Adjusting unit tests for dayly serial > frequencies > >No changes were needed for GetNextDate.t. >In GetFictiveIssueNumber.t we add a subtest for daily frequencies. > >Test plan: >[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Serials/GetFictiveIssueNumber.t | 40 ++++++++++++++++++++++++-- > 1 file changed, 38 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Serials/GetFictiveIssueNumber.t b/t/db_dependent/Serials/GetFictiveIssueNumber.t >index 4d72ce8..0f3613a 100644 >--- a/t/db_dependent/Serials/GetFictiveIssueNumber.t >+++ b/t/db_dependent/Serials/GetFictiveIssueNumber.t >@@ -3,7 +3,7 @@ > # This test deals with GetFictiveIssueNumber (from C4::Serials) > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 5; > > use Koha::Database; > use C4::Serials; >@@ -179,6 +179,42 @@ subtest 'Tests for weekly frequencies' => sub { > is( C4::Serials::GetFictiveIssueNumber($subscription, '1972-02-10'), 4, 'Feb 10 goes to 4' ); > }; > >-# TODO: subtest 'Tests for dayly frequencies' => sub { >+subtest 'Tests for dayly frequencies' => sub { >+ plan tests => 4; >+ >+ # First add a few frequencies >+ my $freq_1i_12d = AddSubscriptionFrequency({ >+ description => "1 issue per 12 days", >+ unit => 'day', >+ issuesperunit => 1, >+ unitsperissue => 12, >+ }); >+ my $freq_3i_1d = AddSubscriptionFrequency({ >+ description => "3 issues per day", >+ unit => 'day', >+ issuesperunit => 3, >+ unitsperissue => 1, >+ }); >+ >+ # TEST CASE - 1 issue per 12 days >+ my $subscription = { >+ periodicity => $freq_1i_12d, >+ firstacquidate => '1972-03-16', >+ countissuesperunit => 1, >+ }; >+ is( C4::Serials::GetFictiveIssueNumber($subscription, '1972-03-27'), 1, 'Mar 27 still 1' ); >+ is( C4::Serials::GetFictiveIssueNumber($subscription, '1972-03-28'), 2, 'Mar 28 goes to 2' ); >+ >+ # TEST CASE - 3 issue per day >+ $subscription = { >+ periodicity => $freq_3i_1d, >+ firstacquidate => '1972-04-23', >+ countissuesperunit => 1, >+ }; >+ $subscription->{countissuesperunit} = 3; >+ is( C4::Serials::GetFictiveIssueNumber($subscription, '1972-05-01'), 27, 'May 1 still 27' ); >+ $subscription->{countissuesperunit} = 1; >+ is( C4::Serials::GetFictiveIssueNumber($subscription, '1972-05-02'), 28, 'May 2 goes to 28' ); >+}; > > $schema->storage->txn_rollback; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18697
:
63846
|
63847
|
63867
|
63868
|
63869
|
63870
|
63871
|
64025
|
64026
|
64027
|
64028
|
64029
|
64317
|
64318
|
64319
|
64320
|
64321