Skip to content

Commit

Permalink
use unique class names in test to make easier to differ from other cl…
Browse files Browse the repository at this point in the history
…asses
  • Loading branch information
TomasVotruba committed May 12, 2022
1 parent 5cbcd07 commit ec1116b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/code/parser/stmt/class/modifier.test
Expand Up @@ -66,7 +66,7 @@ array(
)
)
-----
<?php class A { readonly readonly $a; }
<?php class C { readonly readonly $a; }
-----
!!php7
Multiple readonly modifiers are not allowed from 1:26 to 1:33
Expand All @@ -76,7 +76,7 @@ array(
)
flags: 0
name: Identifier(
name: A
name: C
)
extends: null
implements: array(
Expand Down Expand Up @@ -258,6 +258,7 @@ array(
<?php readonly class A { }
// Type in the partial parse could conceivably be any of 0, 16 or 32
-----
!!php5
Syntax error, unexpected T_READONLY from 1:7 to 1:14
array(
0: Stmt_Class(
Expand All @@ -280,7 +281,7 @@ array(
)
)
-----
<?php class A { abstract $a; }
<?php class B { abstract $b; }
-----
Properties cannot be declared abstract from 1:17 to 1:24
array(
Expand All @@ -289,7 +290,7 @@ array(
)
flags: 0
name: Identifier(
name: A
name: B
)
extends: null
implements: array(
Expand All @@ -303,7 +304,7 @@ array(
props: array(
0: Stmt_PropertyProperty(
name: VarLikeIdentifier(
name: a
name: b
)
default: null
)
Expand Down
46 changes: 46 additions & 0 deletions test/code/parser/stmt/class/readonly.test
Expand Up @@ -6,6 +6,52 @@ readonly class A {
}
-----
!!php7
array(
0: Stmt_Class(
attrGroups: array(
)
flags: MODIFIER_READONLY (64)
name: Identifier(
name: A
)
extends: null
implements: array(
)
stmts: array(
)
)
)
-----
<?php

readonly class A {
}
-----
!!php5
Syntax error, unexpected T_READONLY from 3:1 to 3:8
array(
0: Stmt_Class(
attrGroups: array(
)
flags: 0
name: Identifier(
name: A
)
extends: null
implements: array(
)
stmts: array(
)
)
)
-----
<?php

final readonly class A {
}
-----
!!php7
Syntax error, unexpected T_READONLY, expecting T_CLASS from 3:7 to 3:14
array(
0: Stmt_Class(
attrGroups: array(
Expand Down

0 comments on commit ec1116b

Please sign in to comment.