File: 004-execute.t

package info (click to toggle)
libtest-mockdbi-perl 0.70-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 372 kB
  • sloc: perl: 954; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use warnings;
use strict;
use Test::More;

use_ok('Test::MockDBI');

my $dbh = DBI->connect('DBI:mysql:somedatabase', 'user1', 'password1');

{
  my $sth = $dbh->prepare("SELECT id FROM table1 where id = ?");
  ok($sth->bind_param(1, 1), "bind_param called successfully");
  
  cmp_ok($sth->execute(), '==', -1, "Execute returned -1");
}
done_testing();