@@ -100,19 +100,31 @@ public function rename() {
100
100
$ t ->newInstance ()->rename ();
101
101
}
102
102
103
- #[Test, Values([ ' private ' , ' protected ' ]) ]
104
- public function reflection ( $ modifier ) {
103
+ #[Test]
104
+ public function protected_set_reflection ( ) {
105
105
$ t = $ this ->declare ('class %T {
106
- public ' . $ modifier . ' (set) string $fixture= "Test";
106
+ public protected (set) string $fixture= "Test";
107
107
} ' );
108
108
109
109
Assert::equals (
110
- 'public ' . $ modifier . ' (set) string $fixture ' ,
110
+ 'public protected (set) string $fixture ' ,
111
111
$ t ->property ('fixture ' )->toString ()
112
112
);
113
113
}
114
114
115
- #[Test, Values(['private ' , 'protected ' , 'public ' ])]
115
+ #[Test]
116
+ public function private_set_implicitely_final_in_reflection () {
117
+ $ t = $ this ->declare ('class %T {
118
+ public private(set) string $fixture= "Test";
119
+ } ' );
120
+
121
+ Assert::equals (
122
+ 'public final private(set) string $fixture ' ,
123
+ $ t ->property ('fixture ' )->toString ()
124
+ );
125
+ }
126
+
127
+ #[Test, Values(['protected ' , 'public ' ])]
116
128
public function same_modifier_for_get_and_set ($ modifier ) {
117
129
$ t = $ this ->declare ('class %T {
118
130
' .$ modifier .' ' .$ modifier .'(set) string $fixture= "Test";
@@ -124,6 +136,18 @@ public function same_modifier_for_get_and_set($modifier) {
124
136
);
125
137
}
126
138
139
+ #[Test]
140
+ public function private_modifier_for_get_and_set () {
141
+ $ t = $ this ->declare ('class %T {
142
+ private private(set) string $fixture= "Test";
143
+ } ' );
144
+
145
+ Assert::equals (
146
+ 'private final string $fixture ' ,
147
+ $ t ->property ('fixture ' )->toString ()
148
+ );
149
+ }
150
+
127
151
#[Test]
128
152
public function interaction_with_hooks () {
129
153
$ t = $ this ->declare ('class %T {
0 commit comments