Skip to content

Commit 54083f0

Browse files
committed
Add test for final properties
1 parent a257099 commit 54083f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/php/lang/ast/unittest/parse/MembersTest.class.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ public function private_instance_property() {
4646
$this->assertParsed([$class], 'class A { private $a; }');
4747
}
4848

49+
#[Test]
50+
public function final_instance_property() {
51+
$class= new ClassDeclaration([], new IsValue('\\A'), null, [], [], null, null, self::LINE);
52+
$class->declare(new Property(['public', 'final'], 'a', new IsLiteral('string'), null, null, null, self::LINE));
53+
54+
$this->assertParsed([$class], 'class A { public final string $a; }');
55+
}
56+
4957
#[Test]
5058
public function private_instance_properties() {
5159
$class= new ClassDeclaration([], new IsValue('\\A'), null, [], [], null, null, self::LINE);

0 commit comments

Comments
 (0)