示例#1
0
 /**
  * Converts the object into an array.
  * The default implementation will return all public property values as an array.
  * @return array the array representation of the object
  */
 public function toArray()
 {
     return Creator::getObjectVars($this);
 }
 public function testObjectVars()
 {
     $obj = Creator::createObject(['class' => 'TestCreate', 'test' => 1]);
     $this->assertInstanceOf('TestCreate', $obj);
     $this->assertEquals(get_object_vars($obj), Creator::getObjectVars($obj));
 }