assertEquals(10, $object->Id); $this->assertEquals("Testing", $object->getName()); } public function testBindFromStdClass() { // Matching exact property names $model = new \stdClass(); $model->Id = 10; $model->Name = "Testing"; $object = new SampleModel($model); $this->assertEquals(10, $object->Id); $this->assertEquals("Testing", $object->getName()); // Matching with different case letters $model2 = new \stdClass(); $model2->id = 10; $model2->name = "Testing"; $object = new SampleModel($model2); $this->assertEquals(10, $object->Id); $this->assertEquals("Testing", $object->getName()); } public function testBindFromArray() { $array = array( "Id" => 10, "Name" => "Testing" ); $object = new SampleModel($array); $this->assertEquals(10, $object->Id); $this->assertEquals("Testing", $object->getName()); } public function testPropertyPatternBind() { $obj = new \stdClass(); $obj->Id_Model = 10; $obj->Client_Name = 'Testing'; // Testing Without Property Bind $object = new \Tests\Sample\ModelPropertyPattern(); $object->bindFrom($obj); $this->assertEquals('', $object->getIdModel()); $this->assertEquals('', $object->getClientName()); // Testing with Bind $object = new \Tests\Sample\ModelPropertyPattern(); $object->bindFrom($obj, '/_//'); $this->assertEquals(10, $object->getIdModel()); $this->assertEquals("Testing", $object->getClientName()); // Testing Constructor $object = new \Tests\Sample\ModelPropertyPattern($obj, '/_//'); $this->assertEquals(10, $object->getIdModel()); $this->assertEquals("Testing", $object->getClientName()); } public function testPropertyPatternBind_2() { // Other Testing $obj = new \stdClass(); $obj->IdModel = 10; $obj->ClientName = 'Testing'; $object = new \Tests\Sample\ModelPropertyPattern($obj); $this->assertEquals(10, $object->getIdModel()); $this->assertEquals("Testing", $object->getClientName()); } /** * The current property pattern try do remove the underscore. */ public function testPropertyPatternBind_3() { // Other Testing $obj = [ "clientname" => "Joao", "birthdate" => "1974-01-26" ]; $object = new \Tests\Sample\ModelPropertyPattern(); $object->bindFrom($obj); $this->assertEquals("1974-01-26", $object->getBirthdate()); $this->assertEquals("Joao", $object->getClientName()); } /** * The current property pattern try do remove the underscore. * The setPropertyPattern is done on constructor */ public function testPropertyPatternBind_4() { // Other Testing $obj = [ "birth_date" => "1974-01-26" ]; $object = new \Tests\Sample\ModelPropertyPatternConstruct(); $object->bindFrom($obj); $this->assertEquals("1974-01-26", $object->getBirth_date()); } /** * The current property pattern try do remove the underscore. */ public function testPropertyPatternBind_5() { // Other Testing $obj = [ "birth_date" => "1974-01-26" ]; $object = new \Tests\Sample\ModelPropertyPatternAnnotation($obj); $this->assertEquals("1974-01-26", $object->getBirth_date()); } } __halt_compiler();----SIGNATURE:----Yl28Yf0F5errTWeIIRnchI0kRYYQCOjel8TiXTUkw6NMxz46DrLrN/64n1kRCFEbbyhP1zkAc5LR+qVhfOYNChvJ+Pi9PPCN4IsU1BHcYExSrLWfNu9khr4Yq00kglChOjCK0oto15ZHgmCexdezJ+0AqvT5I+nTIEML5ZqJjNsjurtR6s6JDZ0fIGMwQaTNFoJX26OQVx9/qCExkz3cDpow5AHnNqmf9X2JRLpAbY3Js7dYxPlDdpg6olfNX7q3PuU6OJX/3PEDRSCseOVVJGkPIrBAxIARF8JqQuiA36kfKOMfGBbjjD4pymHpWp9dOWhixnhZj2w6lXigu1emW3emmV1O3Y0VeOmILdHcO4OQ7RoHRK8pNyG6zzYTYORRXCBpy6F2LgMRy3zrebSn/u/d7azu58GSeay6ORRStuiuehiwHnka72Q6TlQi0vdCMatdTgS3wcUxahj6f0K1FLZy5R0ZC9LXOMpr4I9QOE3fnRqZu/dVmmO3E8olg7QQZQGP0ROJkyzzg9BJx165SciTagZuGJpia06ABSYkUc/ftDeUZ3UrcaCX/1mVHViFzRCP1okZk2kmfytlDz/oiLiXr40WruGP2quy60I/BihQYhTn0DsdoX3CklnjO/eCNzKDWAWQNtvHQjSSGFayYn52vZ7Y2fKlny+AncbOLTU=----ATTACHMENT:----NDcxNjE4NDcxNzQ3OTg2NCA5NTQ1MTIwOTE4NTExMzg5IDQ4NTI2NDMzNDQ2NjQ1NTk=