Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sth = $dbh->prepare("SELECT count(*) FROM oai_sets_biblios");
- $sth->execute;
- my $bibliosCount = $sth->fetchrow_array;
- is ($bibliosCount, 2, 'There are 2 biblios in oai_sets_biblios');
- #testing biblio for ste_id1
- $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
- $sth->execute($set1_id);
- my $count = $sth->rows;
- is ($count, '2', '$set_id1 has 2 biblio');
- $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
- $sth->execute($set1_id);
- my $line = ${ $sth->fetchall_arrayref( {} ) }[0];
- is($line->{set_id}, $set1_id, "set_id is good");
- is($line->{biblionumber}, $biblionumber1, "biblionumber is good");
- $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
- $sth->execute($set1_id);
- $line = ${ $sth->fetchall_arrayref( {} ) }[1];
- is($line->{set_id}, $set1_id, "set_id is good");
- is($line->{biblionumber}, $biblionumber2, "biblionumber is good");
- #testing biblio for ste_id2
- $sth = $dbh->prepare("SELECT * FROM oai_sets_biblios WHERE set_id = ?");
- $sth->execute($set2_id);
- $count = $sth->rows;
- is ($count, '0', '$set_id2 has 0 biblio');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement