Bugzilla – Attachment 58266 Details for
Bug 16116
Change of issue publication date doesn't reflect on the next issue generated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16116 - Add unit tests
Bug-16116---Add-unit-tests.patch (text/plain), 2.89 KB, created by
Bouzid Fergani
on 2016-12-16 20:35:54 UTC
(
hide
)
Description:
Bug 16116 - Add unit tests
Filename:
MIME Type:
Creator:
Bouzid Fergani
Created:
2016-12-16 20:35:54 UTC
Size:
2.89 KB
patch
obsolete
>From 19f50f18dc4cc655a54ff2486bfc7256e6d57362 Mon Sep 17 00:00:00 2001 >From: Bouzid Fergani <bouzid.fergani@inlibro.com> >Date: Fri, 16 Dec 2016 15:32:04 -0500 >Subject: [PATCH] Bug 16116 - Add unit tests > >--- > C4/Serials.pm | 3 +++ > t/db_dependent/Serials.t | 32 +++++++++++++++++++++++++++++++- > 2 files changed, 34 insertions(+), 1 deletion(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 26d0cf3..98fd55c 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -87,6 +87,9 @@ BEGIN { > HasItems > &GetSubscriptionsFromBorrower > &subscriptionCurrentlyOnOrder >+ &_get_next_date_week >+ &_get_next_date_month >+ &_get_next_date_year > > ); > } >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index e09a076..80b82a2 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -16,7 +16,7 @@ use C4::Biblio; > use C4::Budgets; > use Koha::DateUtils; > use t::lib::Mocks; >-use Test::More tests => 48; >+use Test::More tests => 51; > > BEGIN { > use_ok('C4::Serials'); >@@ -316,4 +316,34 @@ subtest "Do not generate an expected if one already exists" => sub { > is( @serialsByStatus, 1, "ModSerialStatus delete corectly serial expected and not create another if exists" ); > }; > >+#Unit test Bug 16116 >+ >+$frequency_id = AddSubscriptionFrequency({ description => "Test frequency 1",unit => 'week', unitsperissue => 1, issuesperunit => 1 }); >+$subscriptionid = NewSubscription( >+ undef, "", undef, undef, $budget_id, $biblionumber, >+ '2013-01-01', $frequency_id, undef, undef, undef, >+ undef, undef, undef, undef, undef, undef, >+ 1, $notes,undef, '2013-01-01', undef, $pattern_id, >+ undef, undef, 0, $internalnotes, 0, >+ undef, undef, 0, undef, '2013-12-31', 0 >+ ); >+#Week >+my($year, $month, $day) = ('2016','1','11'); >+$subscription = GetSubscription( $subscriptionid ); >+my $frequencudata = GetSubscriptionFrequency($subscription->{'periodicity'}); >+($year, $month, $day) = _get_next_date_week($subscription,$frequencudata, $year, $month, $day); >+is ("$year-$month-$day","2016-1-18","_get_next_date_week return right next date "); >+ >+#Month >+ModSubscriptionFrequency({ id => $frequency_id, description => "Test frequency 1",unit => 'month', unitsperissue => 1, issuesperunit => 1 }); >+($year, $month, $day) = ('2016','1','11'); >+($year, $month, $day) = _get_next_date_month($subscription,$frequencudata, $year, $month, $day); >+is ("$year-$month-$day","2016-2-11","_get_next_date_month return right next date"); >+ >+#Year >+ModSubscriptionFrequency({ id => $frequency_id, description => "Test frequency 1",unit => 'year', unitsperissue => 1, issuesperunit => 1 }); >+($year, $month, $day) = ('2016','1','11'); >+($year, $month, $day) = _get_next_date_year($subscription,$frequencudata, $year, $month, $day); >+is ("$year-$month-$day","2017-1-11","_get_next_date_year return right next date"); >+ > $dbh->rollback; >-- >1.9.1
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 16116
:
58265
|
58266
|
61002
|
62163