Skip to content

Commit 58fc79e

Browse files
committed
Fix asymmetric visibility tests
1 parent d732885 commit 58fc79e

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/test/php/lang/reflection/unittest/PropertiesTest.class.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,33 @@ public function set_accessing_failed_exceptions_target_member() {
272272
}
273273
}
274274

275-
#[Test, Condition(assert: 'self::$ASYMMETRIC'), Values(['public protected(set)', 'public private(set)', 'protected private(set)'])]
276-
public function asymmetric_visibility($modifiers) {
277-
$t= $this->declare('{ '.$modifiers.' int $fixture; }');
275+
#[Test, Condition(assert: 'self::$ASYMMETRIC')]
276+
public function asymmetric_visibility() {
277+
$t= $this->declare('{ public protected(set) int $fixture; }');
278+
Assert::equals(
279+
'public protected(set) int $fixture',
280+
$t->property('fixture')->toString()
281+
);
282+
}
283+
284+
#[Test, Condition(assert: 'self::$ASYMMETRIC'), Values(['public', 'protected'])]
285+
public function asymmetric_visibility_with_same_get_set_folded($modifiers) {
286+
$t= $this->declare('{ '.$modifiers.' '.$modifiers.'(set) int $fixture; }');
278287
Assert::equals(
279288
$modifiers.' int $fixture',
280289
$t->property('fixture')->toString()
281290
);
282291
}
283292

293+
#[Test, Condition(assert: 'self::$ASYMMETRIC'), Values(['public', 'protected'])]
294+
public function asymmetric_visibility_with_private_become_final($modifiers) {
295+
$t= $this->declare('{ '.$modifiers.' private(set) int $fixture; }');
296+
Assert::equals(
297+
$modifiers.' final private(set) int $fixture',
298+
$t->property('fixture')->toString()
299+
);
300+
}
301+
284302
#[Test, Condition(assert: 'self::$ASYMMETRIC'), Values(['public', 'protected', 'private'])]
285303
public function set_implicit_when_same_as_get($modifier) {
286304
$t= $this->declare('{ '.$modifier.' '.$modifier.'(set) int $fixture; }');

0 commit comments

Comments
 (0)