Exemplo n.º 1
0
 /**
  * @covers flowcode\wing\utils\type\TypeArray::toArray
  * @todo   Implement testToArray().
  */
 public function testToArray()
 {
     $input = new TestEntity("test");
     $output = TypeArray::toArray($input);
     print_r($output);
     $this->assertEquals($input->getName(), $output["name"]);
 }
Exemplo n.º 2
0
 /**
  * Convert any type to json.
  * @param type $object
  * @return json json. 
  */
 public static function toJson($object)
 {
     $array = TypeArray::toArray($object);
     return str_replace('\\u0000', "", json_encode($array));
 }