Fix errors from unit tests

This commit is contained in:
Bart Visscher 2013-07-19 11:07:17 +02:00
parent b66c9098bd
commit be7c613993
2 changed files with 3 additions and 4 deletions

View File

@ -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 />';

View File

@ -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).'? ' . ')';