assertEquals(10, $object->Id); $this->assertEquals("Testing", $object->getName()); } public function testBindFromStdClass() { $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() { $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() { $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() { $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() { $obj = [ "birth_date" => "1974-01-26" ]; $object = new \Tests\Sample\ModelPropertyPatternAnnotation($obj); $this->assertEquals("1974-01-26", $object->getBirth_date()); } } __halt_compiler();----SIGNATURE:----DUoxiTEWJUFRC3XyttgRf7vCrA2pNCjK/nW1+OtAPbobpfysxH0nnQHnGKYzbHjMd1tHGVZSITYQC1rIScfFGKUecfJ4TRxM80n6s02XoC+1g+bvo1ksKmbJTgt9ygEbWM9OtXCL2379L5wWJhS1O1sMIMBiJZb53g2KLZKNJOvTatrAVwF7X1XaF2BKpu0bP/OrMBbNxTEM++n4JtxRzTZlj8mqg3XWRnSB6Mgp3wWD+Yu+daHhIIUzhIDUY8yNBiHRxrQNn9eGWPt0OpPGzvIivWVGXVO5bY6DLAyPckxdVPALZSwqrgXeH5FJn0pH9mzQ1iWBGwLX+aQkMiqujYLuzEGybMBO+QMQGY+4CLgJzXFuOutigLhle+UoH1pd2ATrU9nJBgQgwCoWhSh8DB0WoyfEddtOm6+M0ElpFGvZzO4+Y/ribOzBIYdIX3KVvtz5V76lElIE2xT3xQ2dmrCe6Op71wxU2xaJAeWZlsAH/xpT2q1tfmd3lL01kpqA6dCfkr0S6AWVsg3C5kpb8PfjJQ53+LbZfUq3zSYOxcgLjGbGF6lDsc8OWxy8zQH79bCj8Pr660KlyP7zdfnN82DSPe/GekaATuV+6Xai75fuEVqDT5pVaixFERsox5+HRfqn7Ao0jA3U0lFBv8itnHMQynBmTx88a+CANpLy2tg=----ATTACHMENT:----MzIyMDA1Njk3NTY3MTY1MyAzOTA3NTYwMDAzODcwNjU5IDIwNjY3NTgzNzgzNTU3ODg=