File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -673,6 +673,17 @@ public function testHasChangedWholeEntity()
673673 $ this ->assertTrue ($ entity ->hasChanged ());
674674 }
675675
676+ public function testIssetKeyMap ()
677+ {
678+ $ entity = $ this ->getEntity ();
679+
680+ $ entity ->created_at = '12345678 ' ;
681+ $ this ->assertTrue (isset ($ entity ->createdAt ));
682+
683+ $ entity ->bar = 'foo ' ;
684+ $ this ->assertTrue (isset ($ entity ->FakeBar ));
685+ }
686+
676687 protected function getEntity ()
677688 {
678689 return new class extends Entity
@@ -691,6 +702,10 @@ protected function getEntity()
691702 'created_at ' => null ,
692703 ];
693704
705+ protected $ datamap = [
706+ 'createdAt ' => 'created_at ' ,
707+ ];
708+
694709 public function setBar ($ value )
695710 {
696711 $ this ->attributes ['bar ' ] = "bar: {$ value }" ;
@@ -703,6 +718,10 @@ public function getBar()
703718 return "{$ this ->attributes ['bar ' ]}:bar " ;
704719 }
705720
721+ public function getFakeBar ()
722+ {
723+ return "{$ this ->attributes ['bar ' ]}:bar " ;
724+ }
706725 };
707726 }
708727
You can’t perform that action at this time.
0 commit comments