added unit tests for C4/Serials.pm
authorSam Sanders <sam-sanders@live.com>
Thu, 19 Jan 2012 04:05:16 +0000 (17:05 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 31 Jan 2012 16:21:50 +0000 (17:21 +0100)
http://bugs.koha-community.org/show_bug.cgi?id=5327

t/db_dependent/Serials.t

index 7097642..33f2ac6 100644 (file)
@@ -9,7 +9,7 @@ use YAML;
 
 use C4::Serials;
 use C4::Debug;
-use Test::More tests => 5;
+use Test::More tests => 33;
 
 BEGIN {
     use_ok('C4::Serials');
@@ -40,3 +40,57 @@ if ($subscriptioninformation->{periodicity} % 16==0){
 my $expirationdate = GetExpirationDate(1) ;
 ok( $expirationdate, "not NULL" );
 $debug && warn "$expirationdate";
+
+is(C4::Serials::GetLateIssues(),"0", 'test getting late issues');
+
+ok(C4::Serials::GetSubscriptionHistoryFromSubscriptionId(), 'test getting history from sub-scription');
+
+ok(C4::Serials::GetSerialStatusFromSerialId(), 'test getting Serial Status From Serial Id');
+
+ok(C4::Serials::GetSerialInformation(), 'test getting Serial Information');
+
+ok(C4::Serials::AddItem2Serial(), 'test adding item to serial');
+
+ok(C4::Serials::UpdateClaimdateIssues(), 'test updating claim date');
+
+ok(C4::Serials::GetFullSubscription(), 'test getting full subscription');
+
+ok(C4::Serials::PrepareSerialsData(), 'test preparing serial data');
+
+ok(C4::Serials::GetSubscriptionsFromBiblionumber(), 'test getting subscriptions form biblio number');
+
+is(C4::Serials::GetSerials(),"0", 'test getting serials when you enter nothing');
+is(C4::Serials::GetSerials2(),"0", 'test getting serials when you enter nothing');
+
+ok(C4::Serials::GetLatestSerials(), 'test getting lastest serials');
+
+is(C4::Serials::GetDistributedTo(),"0", 'test getting distributed when nothing is entered');
+
+is(C4::Serials::GetNextSeq(),"0", 'test getting next seq when you enter nothing');
+
+is(C4::Serials::GetSeq(),undef, 'test getting seq when you enter nothing');
+
+is(C4::Serials::CountSubscriptionFromBiblionumber(),"0", 'test counting subscription when nothing is entered');
+
+is(C4::Serials::ModSubscriptionHistory(),"0", 'test modding subscription history');
+
+is(C4::Serials::ModSerialStatus(),undef, 'test modding serials');
+
+is(C4::Serials::NewIssue(),"0", 'test getting 0 when nothing is entered');
+
+is(C4::Serials::ItemizeSerials(),undef, 'test getting nothing when nothing is entered');
+
+ok(C4::Serials::HasSubscriptionStrictlyExpired(), 'test if the subscriptions has expired');
+is(C4::Serials::HasSubscriptionExpired(),"0", 'test if the subscriptions has expired');
+
+is(C4::Serials::GetLateOrMissingIssues(),"0", 'test getting last or missing issues');
+
+is(C4::Serials::removeMissingIssue(),undef, 'test removing a missing issue');
+
+is(C4::Serials::updateClaim(),undef, 'test updating claim');
+
+is(C4::Serials::getsupplierbyserialid(),undef, 'test getting supplier idea');
+
+is(C4::Serials::check_routing(),"0", 'test checking route');
+
+is(C4::Serials::addroutingmember(),undef, 'test adding route member');