Commit be7c6139 authored by Bart Visscher's avatar Bart Visscher
Browse files

Fix errors from unit tests

parent b66c9098
......@@ -38,8 +38,7 @@ class Adapter {
$inserts = array_merge($inserts, $inserts);
try {
$statement = $this->conn->prepare($query);
$result = $statement->execute($inserts);
$result = $this->conn->executeUpdate($query, $inserts);
} catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query.'<br />';
......
......@@ -27,7 +27,7 @@ class AdapterSqlite extends Adapter {
$query = substr($query, 0, strlen($query) - 5);
try {
$stmt = $this->conn->prepare($query);
$result = $stmt->execute(array($input));
$result = $stmt->execute(array_values($input));
} catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />';
......@@ -36,7 +36,7 @@ class AdapterSqlite extends Adapter {
\OC_Template::printErrorPage( $entry );
}
if ($stmt->fetchColumn() === 0) {
if ($stmt->fetchColumn() === '0') {
$query = 'INSERT INTO `' . $table . '` (`'
. implode('`,`', array_keys($input)) . '`) VALUES('
. str_repeat('?,', count($input)-1).'? ' . ')';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment