From 9051471aef9031965fff9185d46982033caf103f Mon Sep 17 00:00:00 2001 From: tonnesen Date: Tue, 29 Oct 2002 19:59:05 +0000 Subject: [PATCH] 3 more circ tests. --- t/webscripts/circulation.t | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/t/webscripts/circulation.t b/t/webscripts/circulation.t index f1add16fee..801e462337 100644 --- a/t/webscripts/circulation.t +++ b/t/webscripts/circulation.t @@ -1,4 +1,4 @@ -BEGIN { $| = 1; print "1..7\n"; +BEGIN { $| = 1; print "1..10\n"; $::intranetdir=`grep intranetdir /etc/koha.conf`; chomp $::intranetdir; $::intranetdir=~s/\s*intranetdir\s*=\s*//i; @@ -32,10 +32,24 @@ my $test='Circulation - findborrowers like "lib"'; my $script="$intranetdir/cgi-bin/circ/circulation.pl 'findborrower=lib'"; contains($script, $test, ['Librarian', 'Generic', 'Enter Book Barcode']); +my $test='Circulation - borrower card number "V10000008"'; +my $script="$intranetdir/cgi-bin/circ/circulation.pl 'findborrower=V10000008'"; +contains($script, $test, ['Librarian', 'Generic', 'Enter Book Barcode']); + my $test='Circulation - issue item "T008" to "librarian"'; -my $script="$intranetdir/cgi-bin/circ/circulation.pl 'barcode=T008&borrnumber=1&branch=MAIN&printer=lp&print=maybe&submit.x=Issue'"; +my $script="$intranetdir/cgi-bin/circ/circulation.pl 'barcode=T008&borrnumber=1&branch=MAIN&printer=lp&print=maybe&day=0&month=0&year=0'"; contains($script, $test, ['Librarian', 'Generic', 'Enter Book Barcode']); +$sth=$dbh->prepare("select date_due from issues where borrowernumber=1 and itemnumber=33 and isnull(returndate)"); +$sth->execute; +if ($sth->rows) { + my ($date_due) = $sth->fetchrow; + # Should check that date_due was set correctly + print "ok ".$testnumber++." entry in issues table.\n"; +} else { + print "not ok ".$testnumber++." no data in issues table.\n"; +} + my $test='Circulation - returns.pl no parameters'; my $script="$intranetdir/cgi-bin/circ/returns.pl"; contains($script, $test, ['Circulation: Returns', 'Enter Book Barcode']); @@ -44,6 +58,16 @@ my $test='Circulation - return item "T008" '; my $script="$intranetdir/cgi-bin/circ/returns.pl 'barcode=T008'"; contains($script, $test, ['Librarian', 'Generic', 'Enter Book Barcode', 'The man in bearskin']); +$sth=$dbh->prepare("select date_due from issues where borrowernumber=1 and itemnumber=33 and isnull(returndate)"); +$sth->execute; +if ($sth->rows) { + my ($date_due) = $sth->fetchrow; + # Should check that date_due was set correctly + print "not ok ".$testnumber++." still not returned in issues table.\n"; +} else { + print "ok ".$testnumber++." marked returned in issues table.\n"; +} + my $test='Circulation - return unissued item "T009" '; my $script="$intranetdir/cgi-bin/circ/returns.pl 'barcode=T008'"; contains($script, $test, ['Enter Book Barcode', 'Not on loan.']); -- 2.39.5