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:----giTpH2uyyJ7DEQhlhL0AFjSmkNB6qvT2zWytoojh2NKSENZ3LJ9swRxSSP3/FnPrZxNmmMZqSz1KAohr+x08QmUU0PCkzVEbgvr5M96IuIoB5X5zxfpKX5dpCT5MlFGaXbPi2Cs0OvgdxJ/Jhd2uTHOcnxGv97bSWtQgVgCed7tl5A4zmFFiuWT1i/ziZ3HoMYSdvSlkXSZnU08uGm3yEzoXNSaqaOzz94gckqFFtjUksJZcVAB57hg7C4q9fJpL2JkWfk8F4M/bGEzUrGTUYUEzaJppeUsjN/uxL4nzqk56SsKQTsSW5NOE6Oi6nZfxpPLkcBd2jM+lZFX8b37yzt1C+Kmq0lW91qb2SYwoSfNs7Jx8O3q0GdSSWgfOPQqci0WcMS7rC/L1cB4MoVbtrQDxAjDCbZ8BgoZrAXKYywpderExX0EWMEAZ2XhaO2nwK5PdIqR0RjDylItFYtt5tndSzNywFc+qPTQTEpdC9dbuFKtEoOpXmL/FChQ9tnT6gsL/MUQeP66rumZDn9LxyUjaDPgN+uJ92gS1izcrShPFFp8lph3C7+qJLMI8FrLM6L95cODT8WCZFa5we0yomdYPw8nTIiGIgWplMlPXLy5EJDvfuz5uJ0WUNNviL0rjtQiidWejOS2RrWnQd14r3/xRxAR/vi0IA+bd0A32vOc=----ATTACHMENT:----MTY1ODkwMzM3Njg0Mzg4MSA2NTU4ODAyMjI2Mjc5OTIxIDEwMjQzMjIzNTM2NDIxNzg=