Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.10 KB | None | 0 0
  1. $sth = $dbh->prepare("SELECT count(*) FROM oai_sets_biblios");
  2. $sth->execute;
  3. my $bibliosCount = $sth->fetchrow_array;
  4. is ($bibliosCount, 2, 'There are 2 biblios in oai_sets_biblios');
  5.  
  6. #testing biblio for ste_id1
  7. $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
  8. $sth->execute($set1_id);
  9. my $count = $sth->rows;
  10. is ($count, '2', '$set_id1 has 2 biblio');
  11.  
  12. $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
  13. $sth->execute($set1_id);
  14. my $line = ${ $sth->fetchall_arrayref( {} ) }[0];
  15. is($line->{set_id}, $set1_id, "set_id is good");
  16. is($line->{biblionumber}, $biblionumber1, "biblionumber is good");
  17.  
  18. $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
  19. $sth->execute($set1_id);
  20. $line = ${ $sth->fetchall_arrayref( {} ) }[1];
  21. is($line->{set_id}, $set1_id, "set_id is good");
  22. is($line->{biblionumber}, $biblionumber2, "biblionumber is good");
  23.  
  24. #testing biblio for ste_id2
  25. $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
  26. $sth->execute($set2_id);
  27. $count = $sth->rows;
  28. is ($count, '0', '$set_id2 has 0 biblio');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement