Exemplo n.º 1
0
 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"]);
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public function toArray()
 {
     $array = parent::toArray();
     $array["valid"] = $this->valid;
     return $array;
 }