/** * Evaluate that string is valid JSON * * @param string $other * @return boolean */ protected function evaluateValid($other) { try { $decodedJson = Zend_Json::decode($other); $this->setActualValue($decodedJson); } catch (Zend_Json_Exception $e) { $this->setActualValue(PHPUnit_Util_Type::shortenedString($other) . "\n" . $e->__toString()); return false; } return true; }