Exemple #1
0
 /**
  * Get the document returned in the body (JSON decoded)
  *
  * @return mixed
  */
 public function getDocument()
 {
     if (!$this->document) {
         require_once 'Sopha/Json.php';
         $this->document = Sopha_Json::decode($this->body);
     }
     return $this->document;
 }
Exemple #2
0
 /**
  * Test encoding and decoding in a single step
  * @param array $values   array of values to test against encode/decode
  */
 protected function _testJson($values)
 {
     $encoded = Sopha_Json::encode($values);
     $this->assertEquals($values, Sopha_Json::decode($encoded));
 }