Exemple #1
0
 /**
  * return a row of data
  *
  * @return void
  * @access public
  */
 public function current()
 {
     if (null === $this->row) {
         $row = $this->result->fetchRow($this->fetchmode);
         if (PEAR::isError($row)) {
             $row = false;
         }
         $this->row = $row;
     }
     return $this->row;
 }
Exemple #2
0
 /**
  * @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);
     }
 }