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:----SQH/XSQjrVChntvRxeUAvQ2bNy8P9JebRZxZRGSlcl4ikAP581qvXBm5L5qdu3laZ9Blghp+mQJf6pb2V2L0I+UrvD6kVToyeTGyIemiAFsgy/Dac6zFXhWRg79J/AUpmF9A39wbs300Hg0x3tXbupGDXlZYcbQs9u2j5Qz3q7Cz2OqsJONDEQL//207mqYm+08k76uQf111IEGcwAmx4AXFfTur9zAoEPw+Ww6LrzDXSit908Drllvw7FCVC0qRIdXDkoRdg9MzoGbzDEHeRAdfVLcSbJ/P4Fj1ftzeNyAguJQi8ytweUJS+GX7GpePzdpjEODdgBAp9B9/cZCo2gKg1pj3UzOwGOOCl/KlJvd08Y7gZYUIwV7+O7eMZBvgWc1ak9U4zWkaaw+4JJzDLdXYy9Q338ZCcAffKyMFZfDXZnQMFKxKA6s1MHqgHzriXqENSjXttWNpwvS7LuLxJNPW5moofmBaHLt0IhOVYgeX+abTDMSg8+vleVgLeWgnt3uvQu7kAXpi3RiUJ7PiycWOp198507DggMuf9JJdXe6W5RTc0hf2RQV5oco6RbDrixdHgn8I/zj0K78PWDzfXSETTlBMi30JJBJqQN8TBKJUi2vfp8KCOIGuBSkzsaVzElaC5ho7eN5WZQmF+RKh4ucn8ovYsggJiC83AqdUyA=----ATTACHMENT:----MjA5NTcyMDU1NDk2MDQ1NiAzMjE3MTkyNDkyNTQ3MTggOTg3MzY5NDU1ODI3OTM1MA==