File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ class LexicalGrammarTest extends TestCase {
17
17
private $ expectedTokensFile ;
18
18
private $ tokens ;
19
19
const FILE_PATTERN = __DIR__ . "/cases/lexical/* " ;
20
+ const PHP84_FILE_PATTERN = __DIR__ . "/cases/lexical84/* " ;
21
+ const PATTERNS_FOR_MINIMUM_PHP_VERSION = [
22
+ [80400 , self ::PHP84_FILE_PATTERN ],
23
+ ];
20
24
public function run (?TestResult $ result = null ) : TestResult {
21
25
if (!isset ($ GLOBALS ["GIT_CHECKOUT_LEXER " ])) {
22
26
$ GLOBALS ["GIT_CHECKOUT_LEXER " ] = true ;
@@ -64,9 +68,23 @@ public function lexicalProvider() {
64
68
if (in_array (basename ($ testCase ), $ skipped )) {
65
69
continue ;
66
70
}
71
+
72
+ if (PHP_VERSION_ID >= 80400 && basename ($ testCase ) === 'keyword5.php ' ) {
73
+ continue ;
74
+ }
75
+
67
76
$ testProviderArray [basename ($ testCase )] = [$ testCase , $ testCase . ".tokens " ];
68
77
}
69
78
79
+ foreach (self ::PATTERNS_FOR_MINIMUM_PHP_VERSION as list ($ minVersionId , $ filePattern )) {
80
+ if (PHP_VERSION_ID >= $ minVersionId ) {
81
+ $ testCases = glob ($ filePattern . ".php " );
82
+ foreach ($ testCases as $ testCase ) {
83
+ $ testProviderArray [basename ($ testCase )] = [$ testCase , $ testCase . ".tokens " ];
84
+ }
85
+ }
86
+ }
87
+
70
88
return $ testProviderArray ;
71
89
}
72
90
Original file line number Diff line number Diff line change
1
+ <?php
2
+ yield /*awesome*/ from
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "kind": "ScriptSectionStartTag",
4
+ "textLength": 6
5
+ },
6
+ {
7
+ "kind": "YieldFromKeyword",
8
+ "textLength": 22
9
+ },
10
+ {
11
+ "kind": "EndOfFileToken",
12
+ "textLength": 0
13
+ }
14
+ ]
You can’t perform that action at this time.
0 commit comments