From 42f90317a53149031adeb8c1731edd3dca0aec05 Mon Sep 17 00:00:00 2001 From: Duncan Tyler Date: Wed, 14 Dec 2011 16:42:30 +1300 Subject: [PATCH] Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm --- t/SIP_ILS.t | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/t/SIP_ILS.t b/t/SIP_ILS.t index 4a3ee70..32ec7d4 100755 --- a/t/SIP_ILS.t +++ b/t/SIP_ILS.t @@ -6,11 +6,24 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 4; BEGIN { use FindBin; use lib "$FindBin::Bin/../C4/SIP"; use_ok('C4::SIP::ILS'); -} +}; +my $transaction = ILS::Transaction::RenewAll->new(); + +$transaction->patron(my $patron = ILS::Patron->new(23529000120056)); + +ok(defined $patron, "patron code: 23529000120056 is valid"); + +my $transaction2 = ILS::Transaction::RenewAll->new(); +$transaction2->patron(my $patron2 = ILS::Patron->new("ABCDE12345")); + +#This test assumes that the patron code ABCDE12345 is invalid +ok(!defined $patron2, "patron code: ABCDE12345 is invalid"); + +ok($transaction->do_renew_all(), "items renewed correctly"); -- 1.7.5.4