@@ -109,6 +109,40 @@ public function testJsonSerialize(): void
109109 // Test JSON encoding
110110 $ this ->assertEquals (json_encode ($ expected ), json_encode ($ model ));
111111 }
112+
113+ public function testMagicGetMethod (): void
114+ {
115+ $ additionalProps = ['buttonText ' => 'Click Me ' , 'caption ' => 'Test Caption ' ];
116+ $ model = $ this ->createConcreteModel ($ additionalProps );
117+
118+ // Test accessing existing properties
119+ $ this ->assertEquals ('test-id ' , $ model ->identifier );
120+ $ this ->assertEquals ('Test Title ' , $ model ->title );
121+
122+ // Test accessing additional properties via magic __get
123+ $ this ->assertEquals ('Click Me ' , $ model ->buttonText );
124+ $ this ->assertEquals ('Test Caption ' , $ model ->caption );
125+
126+ // Test accessing non-existent property
127+ $ this ->assertNull ($ model ->nonExistentProp );
128+ }
129+
130+ public function testMagicIssetMethod (): void
131+ {
132+ $ additionalProps = ['buttonText ' => 'Click Me ' , 'emptyProp ' => '' ];
133+ $ model = $ this ->createConcreteModel ($ additionalProps );
134+
135+ // Test isset on existing properties
136+ $ this ->assertTrue (isset ($ model ->identifier ));
137+ $ this ->assertTrue (isset ($ model ->title ));
138+
139+ // Test isset on additional properties
140+ $ this ->assertTrue (isset ($ model ->buttonText ));
141+ $ this ->assertTrue (isset ($ model ->emptyProp )); // Even empty string should return true for isset
142+
143+ // Test isset on non-existent property
144+ $ this ->assertFalse (isset ($ model ->nonExistentProp ));
145+ }
112146}
113147
114148/**
0 commit comments