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:----L8poAebBgQJ8j0dXGQX9fs1qVMFMOhV/IoqUasyTRLIj4qv0ObE+RuwK0aez6VNsdUzzDugIxZwC0GwdjT0lIfmC/E54lwML4XdT+uIIqagprKRnCgzh9YGwVz2UrUSaP0WVjVH/0M18C4y7JW/jNn2vJS99PUNaj3ONX9oVqZ+ackkivalm4O/Fm0DIlvAXOu+gW14DMnmE1hUbLH4kZWjl3Q6Kr2s7K/HcmXSHRjKLJRr1Hj4I/ZuycRATzE1t92dLUC7QGxGctnHtb+s5utbEmDHv3xbqJs6Pe99sLglDVGyzqg083mgPUDplGCnhWNhslZUDILvWvPPBsjLVqyre+a8eCFxo9npKToyiMGtSqmAtnEN6hxhwk7b1VvsjS+rfdfk9FQZ0JKMukcDtKDsyKC5rUBKf8IVNIbbRdolTXtyh/MuK/xcV/eeqzRWW0TLLAp0RLwQwBgO1HwFZJFJdbdXIE7wuinNlR5QFsR4yhAsEp/0E2GK+3yRQTYNKSERWOGtaMXu6C71SDrj5tIs81qDX15mkpsdATC7IdZIdPt5/kH9buNBdEG7MCcZffqH2iSzqkwMK+ipIU3/VIPMrvtCQC7ZROQcbcNnNFF1el+fxtAT23P3pU1xqGcMdyWlsdVMy8VXzpWvrGvopMj85oRJBXaIlZaseXBYobLE=----ATTACHMENT:----NTU2MjAyOTM0NzA1NDQ2IDIwNTc2ODk5MjI3MTk0NDEgNzI3MzA2NDYzNjQ0MDYwMw==