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:----MwF9Y7kH0oJGINIbauCan7BGjqfUiRUJGhrvJgyWgJtyTocbcFMMwwY5l6IICCn6RYH7ObS+fkmD2r3nDYa4LrtiF/mSBTUnvKVMjoHfnarPXMk0/JLWCHHHQ0xd0TJzAjvCJgeYts9XJzY5R6I/bJ8hmExAipz8s8HskIzLS//vfU+QE4GV+4LnyYqlopK2KD6psFiFWPQHeOKRVZa5NY/KuK5gO5r6+k5i32pS/9jXfFS9fb0r3A+txXR9Z9KkmGuSweQE1b/fM+4X6OnJHaMItQDllhFkNleDG10MxelfITajy07Q3728Rgnu/wzhy+vpNRFqz9wVDIRxaI+sx4l9sANFig0g3ocJ2jExM9mb8XgXNXPcdY1FzRUmRX8Yr1NMb+B7SmJ6mcP5r115M6OHQ6d5GFwRZoLhNLjFDnNJTr3iYtaAfplUYnD/CZjTMvqiNj6/FBdCL5mEFTN64CvJmDD1QkNjTwG9VKuxv0i9tvuh+D/rP5dtWHR29UDyGhMPrspMTYxa96aAO8inoT6pvxfD9wgOUgM13qAOFvuhFHKF4WV/pTwwkdJZloKwwYYPyH1T1+ShHDZwgO6BY0z+aqkujsm3/heMeVXbhvHw/VmtilS72cM8rmMiPv4THuMHhF7yvw9Eecrca7MqFB6ZGXDCC7IlGkWGsiuSj10=----ATTACHMENT:----MTE5Mzc3MDUyMjYwMjg0NiA5OTQxNjk2MjA1NzYyNDE5IDQwMzg0NzYwNTYwODE3Nzk=