/** * @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"]); }
/** * 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)); }