10, 'Name' => 'Joao']); $this->assertEquals(10, $object1->Id); $this->assertEquals('Joao', $object1->getName()); } public function testBind_Array() { $object1 = new SampleModel(); $object1->bindFrom( ['Id' => 10, 'Name' => 'Joao'] ); $this->assertEquals(10, $object1->Id); $this->assertEquals('Joao', $object1->getName()); } public function testBind_StdClass() { $stdClass = new \stdClass(); $stdClass->Id = 10; $stdClass->Name = 'Joao'; $object1 = new SampleModel(); $object1->bindFrom( $stdClass ); $this->assertEquals(10, $object1->Id); $this->assertEquals('Joao', $object1->getName()); } public function testBindTo_Object() { $object1 = new SampleModel(); $object1->Id = 10; $object1->setName('Joao'); $object2 = new SampleModel(); $object1->bindTo($object2); $this->assertEquals(10, $object2->Id); $this->assertEquals('Joao', $object2->getName()); } public function testBindTo_stdClass() { $object1 = new SampleModel(); $object1->Id = 10; $object1->setName('Joao'); $object2 = new \stdClass(); $object1->bindTo($object2); $this->assertEquals(10, $object2->Id); $this->assertEquals('Joao', $object2->Name); } public function testToArray() { $object1 = new SampleModel(); $object1->Id = 10; $object1->setName('Joao'); $object2 = $object1->toArray(); $this->assertEquals(10, $object2['Id']); $this->assertEquals('Joao', $object2['Name']); } public function testComplexBind() { $model = new ModelPublic(20, 'JG'); $data = new \stdClass(); $data->Id = 10; $data->Name = $model; $object = new SampleModel($data); $this->assertEquals(10, $object->Id); $this->assertEquals($model, $object->getName()); } public function testBindToArray() { $this->expectException(InvalidArgumentException::class); $object1 = new SampleModel(); $object1->Id = 10; $object1->setName('Joao'); $array = []; BinderObject::bind($object1, $array); } public function testToArrayFrom() { $object1 = new SampleModel(); $object1->Id = 10; $object1->setName('Joao'); $result = SerializerObject::instance($object1)->serialize(); $this->assertEquals( [ 'Id' => 10, 'Name' => 'Joao' ], $result ); } public function testToArrayFrom2() { $object1 = new ModelPropertyPattern(); $object1->setBirthdate('1974-01-26'); $object1->setClientName('Joao'); $object1->setIdModel(1); $result = SerializerObject::instance($object1)->serialize(); $this->assertEquals( [ 'IdModel' => 1, 'ClientName' => "Joao", 'birthdate' => "1974-01-26" ], $result ); } } __halt_compiler();----SIGNATURE:----MGZR8CxsDeZeXm95fj6GofrgOFjEnkyuEIp7G3+KoHsCQj95Pp19NrzCtkO+iLz5qTK4c2bc/IIMhg9D7k0YEuQILAnei0+Dq98tP4x6xNGUZUkG6WYJEnyM/g1ftt7HdkdkEepdMT0n4nj3sgZjr9l2LixgvGzG1FbfX2dF1ucg3uinvrZqbFZqTfFT3Eg+jWGcbMJYCq3GLfscFa/oVkRc+fP/lJbLdvg/9LaXivg1hMPaaQg1Op6LVKVklMOdGcXEYFmTszoqfwAqWL5FfVlO6uj1wGswhv1qh8k2SfDXfmSwmLXmM9QeHzIZHbo4/3h53sFhcTPzewRcd0pDSRTy/y0WPokHq7CcyViQEc0KEto/AOH4r+uVyZRYyfNqzeSNkMNTfqDmQJ3EhAvDZIBtMjEg4eRFtrcU01gS6zm/uQpwvwu9FoP/rk6yDBQWju4dJN4Lyd72xjZutmEA398AXB5DuesT+qI+oB+x9+zLajkWBIAZvGQx5gk39Oy9XdfBmJ20fhdFzIn9NnxtG+0ZslX1eDb5TUXVWT2VEm7nViUB1c4eWfh9TsFNq+TEhrq1Rn9JUaI0Zh96uJdIolTzuzC+aUXA+SIIxQy54nx5PKI3z+qQFYCWGKB/pRLbfSFWlUqczNNR/D7na0/drID6y92chRsVVNhBpduBnNY=----ATTACHMENT:----NDI1ODM4NjQ3MjA5MzM5NyAxNDQ0OTUzNzUyNjQwODcyIDY1NzMyODk2ODgwNDgwMzg=