Skip to content

Commit 6c7190a

Browse files
More tests
1 parent 4311312 commit 6c7190a

File tree

2 files changed

+84
-4
lines changed

2 files changed

+84
-4
lines changed

tests/Core/File/GetMemberPropertiesTest.inc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ trait DNFTypes {
356356
}
357357

358358
class WithFinalProperties {
359-
/* testPHP84FinaProperty */
360-
final public string $val;
359+
/* testPHP84FinalPublicTypedProp */
360+
final public string $val1;
361+
/* testPHP84FinalProtectedTypedProp */
362+
final protected string $val2;
363+
/* testPHP84FinalMiddleTypedProp */
364+
public final string $val3;
365+
/* testPHP84FinalLastTypedProp */
366+
public readonly final string $val4;
367+
/* testPHP84FinalImplicitVisibilityTypedProp */
368+
final string $val5;
369+
/* testPHP84FinalImplicitVisibilityProp */
370+
final $val6;
361371
}

tests/Core/File/GetMemberPropertiesTest.php

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,8 @@ public static function dataGetMemberProperties()
12081208
'nullable_type' => true,
12091209
],
12101210
],
1211-
'php8.4-final-property' => [
1212-
'identifier' => '/* testPHP84FinaProperty */',
1211+
'php8.4-final-public-property' => [
1212+
'identifier' => '/* testPHP84FinalPublicTypedProp */',
12131213
'expected' => [
12141214
'scope' => 'public',
12151215
'scope_specified' => true,
@@ -1222,6 +1222,76 @@ public static function dataGetMemberProperties()
12221222
'nullable_type' => false,
12231223
],
12241224
],
1225+
'php8.4-final-protected-property' => [
1226+
'identifier' => '/* testPHP84FinalProtectedTypedProp */',
1227+
'expected' => [
1228+
'scope' => 'protected',
1229+
'scope_specified' => true,
1230+
'is_static' => false,
1231+
'is_readonly' => false,
1232+
'is_final' => true,
1233+
'type' => 'string',
1234+
'type_token' => -2,
1235+
'type_end_token' => -2,
1236+
'nullable_type' => false,
1237+
],
1238+
],
1239+
'php8.4-final-middle-keyword-property' => [
1240+
'identifier' => '/* testPHP84FinalMiddleTypedProp */',
1241+
'expected' => [
1242+
'scope' => 'public',
1243+
'scope_specified' => true,
1244+
'is_static' => false,
1245+
'is_readonly' => false,
1246+
'is_final' => true,
1247+
'type' => 'string',
1248+
'type_token' => -2,
1249+
'type_end_token' => -2,
1250+
'nullable_type' => false,
1251+
],
1252+
],
1253+
'php8.4-final-last-keyword-property' => [
1254+
'identifier' => '/* testPHP84FinalLastTypedProp */',
1255+
'expected' => [
1256+
'scope' => 'public',
1257+
'scope_specified' => true,
1258+
'is_static' => false,
1259+
'is_readonly' => true,
1260+
'is_final' => true,
1261+
'type' => 'string',
1262+
'type_token' => -2,
1263+
'type_end_token' => -2,
1264+
'nullable_type' => false,
1265+
],
1266+
],
1267+
'php8.4-final-implicit-public-typed-property' => [
1268+
'identifier' => '/* testPHP84FinalImplicitVisibilityTypedProp */',
1269+
'expected' => [
1270+
'scope' => 'public',
1271+
'scope_specified' => false,
1272+
'is_static' => false,
1273+
'is_readonly' => false,
1274+
'is_final' => true,
1275+
'type' => 'string',
1276+
'type_token' => -2,
1277+
'type_end_token' => -2,
1278+
'nullable_type' => false,
1279+
],
1280+
],
1281+
'php8.4-final-implicit-public-untyped-property' => [
1282+
'identifier' => '/* testPHP84FinalImplicitVisibilityProp */',
1283+
'expected' => [
1284+
'scope' => 'public',
1285+
'scope_specified' => false,
1286+
'is_static' => false,
1287+
'is_readonly' => false,
1288+
'is_final' => true,
1289+
'type' => '',
1290+
'type_token' => false,
1291+
'type_end_token' => false,
1292+
'nullable_type' => false,
1293+
],
1294+
],
12251295
];
12261296

12271297
}//end dataGetMemberProperties()

0 commit comments

Comments
 (0)