koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/t/webscripts catalog.t,1.1.2.2,1.1.2.3


From: Steve Tonnesen
Subject: [Koha-cvs] CVS: koha/t/webscripts catalog.t,1.1.2.2,1.1.2.3
Date: Tue, 29 Oct 2002 11:26:29 -0800

Update of /cvsroot/koha/koha/t/webscripts
In directory usw-pr-cvs1:/tmp/cvs-serv31393/t/webscripts

Modified Files:
      Tag: rel-1-2
        catalog.t 
Log Message:
Added some more tests to catalog.t


Index: catalog.t
===================================================================
RCS file: /cvsroot/koha/koha/t/webscripts/Attic/catalog.t,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** catalog.t   29 Oct 2002 18:05:09 -0000      1.1.2.2
--- catalog.t   29 Oct 2002 19:26:27 -0000      1.1.2.3
***************
*** 1,3 ****
! BEGIN { $| = 1; print "1..19\n";
      $::intranetdir=`grep intranetdir /etc/koha.conf`;
      chomp $::intranetdir;
--- 1,3 ----
! BEGIN { $| = 1; print "1..28\n";
      $::intranetdir=`grep intranetdir /etc/koha.conf`;
      chomp $::intranetdir;
***************
*** 14,17 ****
--- 14,20 ----
  print "ok 1 Test script load\n";
  
+ my $dbh=C4::Context->dbh();
+ my $sth;
+ 
  my $debug=$ARGV[0];
  
***************
*** 80,85 ****
  # Add subject headings for #163 to catalogueentry table
  
! my $dbh=C4::Context->dbh();
! my $sth=$dbh->prepare("select * from catalogueentry where entrytype='s' and 
catalogueentry=?");
  $sth->execute('UNITED STATES-MANUFACTURERS-CATALOGUE');
  unless ($sth->rows) {
--- 83,87 ----
  # Add subject headings for #163 to catalogueentry table
  
! $sth=$dbh->prepare("select * from catalogueentry where entrytype='s' and 
catalogueentry=?");
  $sth->execute('UNITED STATES-MANUFACTURERS-CATALOGUE');
  unless ($sth->rows) {
***************
*** 98,113 ****
--- 100,158 ----
  contains($script, $test, ['location: detail.pl', 'bib=163']);
  
+ $sth=$dbh->prepare("select title from biblio where biblionumber=163");
+ $sth->execute();
+ my ($title) = $sth->fetchrow;
+ if ($title eq 'Testing') {
+     print "ok ".$testnumber++." title is now 'Testing'\n";
+ } else {
+     print "not ok ".$testnumber++." title is now $title\n";
+ }
+ 
+ 
  $test='Modify Biblio change title back to "The Historical Supply Catalogue" - 
biblio #163';
  $script="$intranetdir/cgi-bin/updatebiblio.pl 
'Author=Wellikoff%2C+Alan&Title=The+Historical+Supply+Catalogue&Subject=UNITED+STATES-MANUFACTURERS-CATALOGUE%7CCATALOGUES-HISTORICAL+SUPPLIES&Copyright=&Series=&Additional=&Subtitle=&Unititle=&Notes=&Serial=&Analytic=&Analytic=&bibnum=163&bibitemnum=163'";
  contains($script, $test, ['location: detail.pl', 'bib=163']);
  
+ $sth=$dbh->prepare("select title from biblio where biblionumber=163");
+ $sth->execute();
+ my ($title) = $sth->fetchrow;
+ if ($title eq 'The Historical Supply Catalogue') {
+     print "ok ".$testnumber++." title is now 'The Historical Supply 
Catalogue'\n";
+ } else {
+     print "not ok ".$testnumber++." title is now $title\n";
+ }
+ 
  $test='Delete Biblio with items - biblio #163';
  $script="$intranetdir/cgi-bin/delbiblio.pl 'biblio=163'";
  contains($script, $test, ['delete them before deleting this biblio']);
  
+ $sth=$dbh->prepare("select biblionumber from biblio where biblionumber=163");
+ $sth->execute;
+ if ($sth->rows) {
+     print "ok ".$testnumber++." biblio 163 was not deleted.\n";
+ } else {
+     print "not ok ".$testnumber++." biblio 163 is gone!\n";
+ }
+ 
  $test='Delete Biblio with no items - biblio #57';
  $script="$intranetdir/cgi-bin/delbiblio.pl 'biblio=57'";
  contains($script, $test, ['location:', 'catalogue-home.pl']);
  
+ $sth=$dbh->prepare("select * from biblio where biblionumber=57");
+ $sth->execute;
+ if ($sth->rows) {
+     print "not ok ".$testnumber++." biblio 57 is still in biblio table!\n";
+ } else {
+     print "ok ".$testnumber++." biblio 57 was deleted.\n";
+ }
+ 
+ $sth=$dbh->prepare("select biblionumber from deletedbiblio where 
biblionumber=57");
+ $sth->execute;
+ if ($sth->rows) {
+     print "ok ".$testnumber++." biblio 57 is in deletedbiblio table.\n";
+ } else {
+     print "not ok ".$testnumber++." biblio 57 is not in deletedbiblio 
table!\n";
+ }
+ 
  my $query="select * from deletedbiblio where biblionumber=57";
  $sth=$dbh->prepare($query);
***************
*** 130,137 ****
  }
  
! $test='Modify biblioitem (group) - biblio #331';
  $script="$intranetdir/cgi-bin/modbibitem.pl 
'bibitem=331&biblio=331&submit.x=62&submit=modify'";
  contains($script, $test, ['Dog stories', 'Herriot, James', 'T291', 331]);
  
  
  
--- 175,208 ----
  }
  
! $test='Modify biblioitem (group) - biblioitem #331';
  $script="$intranetdir/cgi-bin/modbibitem.pl 
'bibitem=331&biblio=331&submit.x=62&submit=modify'";
  contains($script, $test, ['Dog stories', 'Herriot, James', 'T291', 331]);
  
+ $test='Modify biblioitem (group) change itemtype to JNF - biblioitem #331';
+ $script="$intranetdir/cgi-bin/updatebibitem.pl 
'existinggroup=331&existing=NO&Item=JNF&Class=HER&Publisher=&Place=&ISBN=0330296957&Publication=0&Pages=20p.+Illus.&Illustrations=&Volume=&Notes=&Size=&bibnum=331&bibitemnum=331&check_group_T291=on&submit.x=103&submit.y=30'";
+ contains($script, $test, ['location:', 'moredetail.pl', 331]);
+ 
+ $sth=$dbh->prepare("select itemtype from biblioitems where 
biblioitemnumber=331");
+ $sth->execute();
+ my ($itemtype) = $sth->fetchrow;
+ if ($itemtype eq 'JNF') {
+     print "ok ".$testnumber++." itemtype is now JNF\n";
+ } else {
+     print "not ok ".$testnumber++." itemtype is now $itemtype\n";
+ }
+ 
+ $test='Modify biblioitem (group) change itemtype back to JF - biblioitem 
#331';
+ $script="$intranetdir/cgi-bin/updatebibitem.pl 
'existinggroup=331&existing=NO&Item=JF&Class=HER&Publisher=&Place=&ISBN=0330296957&Publication=0&Pages=20p.+Illus.&Illustrations=&Volume=&Notes=&Size=&bibnum=331&bibitemnum=331&check_group_T291=on&submit.x=103&submit.y=30'";
+ contains($script, $test, ['location:', 'moredetail.pl', 331]);
+ 
+ 
+ $sth=$dbh->prepare("select itemtype from biblioitems where 
biblioitemnumber=331");
+ $sth->execute();
+ my ($itemtype) = $sth->fetchrow;
+ if ($itemtype eq 'JF') {
+     print "ok ".$testnumber++." itemtype is now JF\n";
+ } else {
+     print "not ok ".$testnumber++." itemtype is now $itemtype\n";
+ }
  
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]