public function testImport() { $this->parcel->import(array("a" => 1, "b" => 2)); $php = json_decode($this->parcel->toJson(), true); $this->assertEquals(1, $php["data"]["a"]); $this->assertEquals(2, $php["data"]["b"]); }
public function toArray() { $thrown = $this->hasExceptionBeenThrown(); $array = parent::toArray(); $array["success"] = $this->success; $array["has_exception_been_thrown"] = $thrown; if ($thrown) { $array["exception_message"] = $this->getException()->getMessage(); } return $array; }
public function toArray() { $array = parent::toArray(); $array["valid"] = $this->valid; return $array; }