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:----F3hGOj5s6ouHq8GLx+tgpfeGE/6AqmHEoe4VWrK+E6RuA+9Sz6YxG/x7nhCahPeI0oApjqBGA+AMhCl8gYn8jnuXVI+CdcIqqkgaypVts9Ev09rJUjRV8So1gMR17+aRGBLb2jrCW9PA6F1xy5s9FJpOtGFIc5WHjTweJ8oGKnq9u2UbOW6+LbyMB/Qo72sSgRhrIGC2OoJZJEEgIOM4NPC9kVXMZp3mKPriaQ2fToEVWbcheZNXlTOF0ODjGc79o0v0FXRkS9b6J085W6HLe0ywV3nkedRM53rdGHZWf5KL/7qMtzFi32TKNuphhgSBVaQpS8LeHYXSui0PpjeexTeVjNkrBw3BgU3D5qbOr5KBLnSaXsxeQe0EuZi0ofpEi+vMfEF5QM9L+/41oJ8yVAnQc2GCFkbWZFSLEoQduTC2slnwovHbAJg5FUCjgecavjACnv00Dp4rwOIK2JRjqvHqAlrAa6R2kgNDBjuZ5sMBfOm1uQIvCTuPC651i2ADOk6EGXylvbso+NGF4WmW8m00LMJs42kuU3n10DFo8RHQeA3YIiVjq3wrloslnRNXnPFEYkOLpiIUzSwyd+dYz67e9uJS/vPRehM/QPKAbgix+0Ww+4Ns8CPAIaIW+MvA4Sh6Lhr37JALb9V8huzxGRX0jLaOtX21N7oTcE2UzRc=----ATTACHMENT:----MzkyMjQzNzc3NTk4NzYyMCAxNzA5MTk3ODE5NzgxMDQgNDkzOTk2MDc4ODE4Njc2Mg==