diff --git a/t/SQL.t b/t/SQL.t index 7c3982a87..483ea065e 100644 --- a/t/SQL.t +++ b/t/SQL.t @@ -174,7 +174,7 @@ SKIP: { skip("No InnoDB tables in this MySQL. Skipping all transaction related tests.",7) if (lc $mysqlVariables{have_innodb} ne 'yes'); $session->db->dbh->do('DROP TABLE IF EXISTS testTable'); $session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message CHAR(64), PRIMARY KEY(myIndex)) TYPE=InnoDB'); - addToCleanup( sub { $session->db->dbh->do('DROP TABLE testTable') }); + addToCleanup( SQL => 'DROP TABLE testTable' ); my $dbh2 = WebGUI::SQL->connect($session,$session->config->get("dsn"), $session->config->get("dbuser"), $session->config->get("dbpass")); my ($sth, $sth2, $rc); diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 53d0c2eae..49f141ce2 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -819,6 +819,10 @@ Example call: my ($class, $ident) = @_; return WebGUI::Storage->get($CLASS->session, $ident); }, + 'SQL' => sub { + my (undef, $sql) = @_; + return $CLASS->session->db->dbh->prepare($sql); + }, ); my %clone = ( @@ -898,6 +902,7 @@ Example call: 'CODE' => sub { (shift)->(); }, + 'SQL' => 'execute', ); sub cleanupGuard {