[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/t/webscripts acquisitions-simple.t,1.1.2.1,1.1.2.2
From: |
Steve Tonnesen |
Subject: |
[Koha-cvs] CVS: koha/t/webscripts acquisitions-simple.t,1.1.2.1,1.1.2.2 |
Date: |
Wed, 30 Oct 2002 11:21:31 -0800 |
Update of /cvsroot/koha/koha/t/webscripts
In directory usw-pr-cvs1:/tmp/cvs-serv30731
Modified Files:
Tag: rel-1-2
acquisitions-simple.t
Log Message:
Added some more acquisitions tests
Index: acquisitions-simple.t
===================================================================
RCS file: /cvsroot/koha/koha/t/webscripts/Attic/acquisitions-simple.t,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** acquisitions-simple.t 30 Oct 2002 06:38:30 -0000 1.1.2.1
--- acquisitions-simple.t 30 Oct 2002 19:21:27 -0000 1.1.2.2
***************
*** 43,54 ****
contains($script, $test, ['input name=publishercode', 'input
name=publicationyear', 'input name=place', 'input name=illus',
'name=biblionumber value=501']);
my $test='Acquisitions/Simple - addbooks.pl ISBN=0920541968 Section Two';
! my $script="$intranetdir/cgi-bin/acqui.simple/addbooks.pl
'isbn=0920541968&biblionumber=501&newbiblioitem=1&publisher=Stratton+and+Co.&publicationyear=1997&place=New+York&illus=Margaret+Reinhard&additionalauthors=Margaret+Reinhard&subjectheadings=&itemtype=NF&dewey=372.6&subclass=FOR&issn=&lccn=&volume=&pages=335p.&size=10in.¬es=Test+biblioitem+added+by+Koha+test+scripts'";
contains($script, $test, ['name=newitem value=1', 'name=biblionumber
value=501', 'name=biblioitemnumber value=501', 'input name=barcode']);
my $test='Acquisitions/Simple - addbooks.pl ISBN=0920541968 Section Three';
my $script="$intranetdir/cgi-bin/acqui.simple/addbooks.pl
'newitem=1&biblionumber=501&biblioitemnumber=501&barcode=T777&homebranch=MAIN&replacementprice=17.99¬es=Test+item+added+by+Koha+test+harness.'";
contains($script, $test, ['input name=isbn']);
$sth=$dbh->do("delete from items where biblionumber=501");
--- 43,96 ----
contains($script, $test, ['input name=publishercode', 'input
name=publicationyear', 'input name=place', 'input name=illus',
'name=biblionumber value=501']);
+ $sth=$dbh->prepare("select title,author from biblio where biblionumber=501");
+ $sth->execute;
+ my ($title, $author) = $sth->fetchrow;
+ $sth=$dbh->prepare("select subtitle from bibliosubtitle where
biblionumber=501");
+ $sth->execute;
+ my ($subtitle) = $sth->fetchrow;
+ if ($title eq 'On the Move' and $author eq 'Forester, Anne D.' && $subtitle
eq 'Teaching the Learners Way In Grades 4-7') {
+ print "ok ".$testnumber++." biblio added correctly.\n";
+ } else {
+ print "not ok ".$testnumber++." biblio not added correctly.\n";
+ }
+
my $test='Acquisitions/Simple - addbooks.pl ISBN=0920541968 Section Two';
! my $script="$intranetdir/cgi-bin/acqui.simple/addbooks.pl
'isbn=0920541968&biblionumber=501&newbiblioitem=1&publishercode=Stratton+and+Co.&publicationyear=1997&place=New+York&illus=Margaret+Reinhard&additionalauthors=Margaret+Reinhard&subjectheadings=&itemtype=NF&dewey=372.6&subclass=FOR&issn=&lccn=&volume=&pages=335p.&size=10in.¬es=Test+biblioitem+added+by+Koha+test+scripts'";
contains($script, $test, ['name=newitem value=1', 'name=biblionumber
value=501', 'name=biblioitemnumber value=501', 'input name=barcode']);
+ $sth=$dbh->prepare("select
isbn,publishercode,publicationyear,place,illus,itemtype,dewey from biblioitems
where biblioitemnumber=501");
+ $sth->execute;
+ my ($isbn,$publishercode,$publicationyear,$place,$illus,$itemtype,$dewey) =
$sth->fetchrow;
+ if (
+ $isbn eq '0920541968' and
+ $publishercode eq 'Stratton and Co.' and
+ $publicationyear == 1997 and
+ $place eq "New York" and
+ $illus eq "Margaret Reinhard" and
+ $itemtype eq 'NF' and
+ $dewey == 372.6
+ ) {
+ print "ok ".$testnumber++." biblioitem added correctly.\n";
+ } else {
+ print "not ok ".$testnumber++." biblioitem not added correctly. $isbn
$publishercode $publicationyear $place $illus $itemtype $dewey\n";
+ }
+
my $test='Acquisitions/Simple - addbooks.pl ISBN=0920541968 Section Three';
my $script="$intranetdir/cgi-bin/acqui.simple/addbooks.pl
'newitem=1&biblionumber=501&biblioitemnumber=501&barcode=T777&homebranch=MAIN&replacementprice=17.99¬es=Test+item+added+by+Koha+test+harness.'";
contains($script, $test, ['input name=isbn']);
+ $sth=$dbh->prepare("select barcode,homebranch,replacementprice,itemnotes from
items where biblioitemnumber=501");
+ $sth->execute;
+ my ($barcode,$homebranch,$replacementprice,$notes) = $sth->fetchrow;
+ if (
+ $barcode eq 'T777' and
+ $homebranch eq 'MAIN' and
+ $replacementprice == 17.99 and
+ $notes eq 'Test item added by Koha test harness.'
+ ) {
+ print "ok ".$testnumber++." item added correctly.\n";
+ } else {
+ print "not ok ".$testnumber++." item not added correctly. $barcode,
$homebranch, $replacementprice, $notes\n";
+ }
$sth=$dbh->do("delete from items where biblionumber=501");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/t/webscripts acquisitions-simple.t,1.1.2.1,1.1.2.2,
Steve Tonnesen <=