File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ public function __get($name)
4545 return null ;
4646 }
4747
48+ public function __isset ($ property )
49+ {
50+ return isset ($ this ->methods [$ property ]);
51+ }
52+
53+ public function __unset ($ property )
54+ {
55+ unset($ this ->methods [$ property ]);
56+ }
57+
4858 public function __toString ()
4959 {
5060 return "" ;
Original file line number Diff line number Diff line change @@ -24,6 +24,19 @@ public function testCanAccessAsProperty()
2424 $ this ->assertSame (42 , $ stub ->property );
2525 }
2626
27+ public function testPropertiesCanBeSeenByIsset ()
28+ {
29+ $ stub = new Stub (['property ' => 42 ]);
30+ $ this ->assertTrue (isset ($ stub ->property ), 'Properies can be seen by isset ' );
31+ }
32+
33+ public function testPropertiesCanBeUnset ()
34+ {
35+ $ stub = new Stub (['property ' => 42 ]);
36+ unset($ stub ->property );
37+ $ this ->assertFalse (isset ($ stub ->property ), 'Properies can be unset ' );
38+ }
39+
2740 public function testThatItWillCallAAnonomusCallable ()
2841 {
2942 $ identity = function ($ argument ) {
You can’t perform that action at this time.
0 commit comments