File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/test/php/lang/ast/unittest/emit Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,22 @@ public function rename($name) {
28
28
return $this;
29
29
}
30
30
} ' );
31
+
32
+ Assert::throws (Error::class, fn () => $ t ->newInstance ()->fixture = 'Changed ' );
33
+ Assert::equals ('Changed ' , $ t ->newInstance ()->rename ('Changed ' )->fixture );
34
+ }
35
+
36
+ #[Test]
37
+ public function writing_from_inherited_scope () {
38
+ $ parent = $ this ->declare ('class %T { public protected(set) $fixture= "Test"; } ' );
39
+ $ t = $ this ->declare ('class %T extends ' .$ parent ->literal ().' {
40
+ public function rename($name) {
41
+ $this->fixture= $name;
42
+ return $this;
43
+ }
44
+ } ' );
45
+
46
+ Assert::throws (Error::class, fn () => $ t ->newInstance ()->fixture = 'Changed ' );
31
47
Assert::equals ('Changed ' , $ t ->newInstance ()->rename ('Changed ' )->fixture );
32
48
}
33
49
You can’t perform that action at this time.
0 commit comments