/** * check whether the value of a cell matches * * @param PHPFIT_Parse $cell, * @param PHPFIT_TypeAdapter $adapter */ public function checkCell($cell, $adapter) { $text = $cell->text(); if ($text == '') { try { $this->info($cell, $adapter->toString()); } catch (Exception $e) { $this->info($cell, 'error'); } } else { if ($adapter == null) { $this->ignore($cell); } else { if (strncmp($text, 'error', 5) == 0) { try { $result = $adapter->invoke(); $this->wrong($cell, $adapter->valueToString($result)); } catch (Exception $e) { $this->right($cell); } } else { try { $value = $adapter->get(); if ($adapter->valueEquals($value, $text)) { $this->right($cell); } else { $this->wrong($cell, $adapter->valueToString($value)); } } catch (Exception $e) { $this->exception($cell, $e); } } } } }