/** * Free the internal resources associated with result. * * @return bool|MDB2_Error true on success, false|MDB2_Error if result is invalid * @access public */ public function free() { if ($this->result) { return $this->result->free(); } $this->result = false; $this->row = null; return false; }
/** * @param MDB2_Result_Common $result the query result to check * @param type $rownum the row in the $result to check * @param type $data the expected data * @return bool */ public function verifyFetchedValues(&$result, $rownum, $data) { $row = $result->fetchRow(MDB2_FETCHMODE_ASSOC, $rownum); if (!is_array($row)) { $result->free(); $this->fail('Error result row is not an array'); return; } foreach ($this->fields as $field => $type) { $value = $row[$field]; if ($type == 'float') { $delta = 1.0E-10; } else { $delta = 0; } $this->assertEquals($data[$field], $value, "the value retrieved for field \"{$field}\" doesn't match what was stored into the rownum {$rownum}", $delta); } }