From 61864634a587a59544db86bc1c30c491291d06e1 Mon Sep 17 00:00:00 2001
From: Mark Tompsett <mtompset@hotmail.com>
Date: Tue, 21 Apr 2015 21:46:32 -0400
Subject: [PATCH] Bug 14036 - GetNextDate.t lacking test cases.

Two test cases were added to improve testing. This catches the
problem encountered by Rolando Isidoro.

TEST PLAN
---------
1) Apply this test patch first.
2) prove t/db_dependent/Serials/GetNextDate.t
   -- this should bomb horribly.
3) Apply the other patch.
4) prove t/db_dependent/Serials/GetNextDate.t
   -- this should succeed.
5) koha qa test tools
---
 t/db_dependent/Serials/GetNextDate.t | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/t/db_dependent/Serials/GetNextDate.t b/t/db_dependent/Serials/GetNextDate.t
index 1572d0a..db03ff4 100644
--- a/t/db_dependent/Serials/GetNextDate.t
+++ b/t/db_dependent/Serials/GetNextDate.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use C4::Context;
-use Test::More tests => 86;
+use Test::More tests => 88;
 use Modern::Perl;
 
 my $dbh = C4::Context->dbh;
@@ -26,7 +26,14 @@ my $subscription = {
     irregularity => '',
     countissuesperunit => 1,
 };
-my $publisheddate = $subscription->{firstacquidate};
+
+my $publisheddate = GetNextDate($subscription, '0000-00-00');
+is($publisheddate, undef, "0000-00-00 is an expected undef date.");
+
+$publisheddate = GetNextDate($subscription, '9999-99-99');
+is($publisheddate, undef, "9999-99-99 is an expected undef date.");
+
+$publisheddate = $subscription->{firstacquidate};
 
 $publisheddate = GetNextDate($subscription, $publisheddate);
 is($publisheddate, '1970-01-02');
-- 
1.9.1