@@ -18,6 +18,19 @@ public function run() {
18
18
Assert::equals ('Test ' , $ r );
19
19
}
20
20
21
+ #[Test]
22
+ public function typed_class_property () {
23
+ $ r = $ this ->run ('class <T> {
24
+ private static string $MEMBER= "Test";
25
+
26
+ public function run() {
27
+ return self::$MEMBER;
28
+ }
29
+ } ' );
30
+
31
+ Assert::equals ('Test ' , $ r );
32
+ }
33
+
21
34
#[Test]
22
35
public function class_method () {
23
36
$ r = $ this ->run ('class <T> {
@@ -44,6 +57,19 @@ public function run() {
44
57
Assert::equals ('Test ' , $ r );
45
58
}
46
59
60
+ #[Test]
61
+ public function typed_class_constant () {
62
+ $ r = $ this ->run ('class <T> {
63
+ private const string MEMBER = "Test";
64
+
65
+ public function run() {
66
+ return self::MEMBER;
67
+ }
68
+ } ' );
69
+
70
+ Assert::equals ('Test ' , $ r );
71
+ }
72
+
47
73
#[Test]
48
74
public function dynamic_class_property () {
49
75
$ r = $ this ->run ('class <T> {
@@ -154,6 +180,19 @@ public function run() {
154
180
Assert::equals ('Test ' , $ r );
155
181
}
156
182
183
+ #[Test]
184
+ public function typed_instance_property () {
185
+ $ r = $ this ->run ('class <T> {
186
+ private string $member= "Test";
187
+
188
+ public function run() {
189
+ return $this->member;
190
+ }
191
+ } ' );
192
+
193
+ Assert::equals ('Test ' , $ r );
194
+ }
195
+
157
196
#[Test]
158
197
public function instance_method () {
159
198
$ r = $ this ->run ('class <T> {
0 commit comments