* get the stored metadata of a file or folder
*
* @param string/int $file
- * @return array
+ * @return array | false
*/
public function get($file) {
if (is_string($file) or $file == '') {
$result = $query->execute($params);
$data = $result->fetchRow();
+ //FIXME hide this HACK in the next database layer, or just use doctrine and get rid of MDB2 and PDO
+ //PDO returns false, MDB2 returns null, oracle always uses MDB2, so convert null to false
+ if ($data === null) {
+ $data = false;
+ }
+
//merge partial data
if (!$data and is_string($file)) {
if (isset($this->partial[$file])) {
$result = $query->execute(array('uri_1'));
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
- $this->assertFalse($row);
+ $this->assertFalse((bool)$row); //PDO returns false, MDB2 returns null
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
$result = $query->execute(array('fullname test', 'uri_1'));
$this->assertTrue((bool)$result);
$this->assertArrayHasKey('fullname', $row);
$this->assertEquals($row['fullname'], 'fullname test');
$row = $result->fetchRow();
- $this->assertFalse($row);
+ $this->assertFalse((bool)$row); //PDO returns false, MDB2 returns null
}
public function testNOW() {