Skip to content

Commit a3536f5

Browse files
committed
Refactor can_have_readonly_fields() test to be forward-compatible
1 parent a3a3f8d commit a3536f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/php/lang/ast/syntax/php/unittest/RecordsTest.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public function can_declare_field_modifiers() {
4949
#[Test]
5050
public function can_have_readonly_fields() {
5151
$t= $this->declare('record %T(public readonly string $name) { }');
52-
Assert::equals(MODIFIER_PUBLIC | MODIFIER_READONLY, $t->property('name')->modifiers()->bits());
52+
$modifiers= $t->property('name')->modifiers();
53+
54+
Assert::true($modifiers->isPublic() && $modifiers->isReadonly());
5355
}
5456

5557
#[Test, Expect(class: Error::class, message: '/Cannot modify readonly property .+name/')]

0 commit comments

Comments
 (0)