MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestArrayDimFetch

Function TestArrayDimFetch

node/expr/t_array_dim_fetch_test.go:17–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestArrayDimFetch(t *testing.T) {
18 src := `<? $a[1];`
19
20 expected := &node.Root{
21 Position: &position.Position{
22 StartLine: 1,
23 EndLine: 1,
24 StartPos: 3,
25 EndPos: 9,
26 },
27 Stmts: []node.Node{
28 &stmt.Expression{
29 Position: &position.Position{
30 StartLine: 1,
31 EndLine: 1,
32 StartPos: 3,
33 EndPos: 9,
34 },
35 Expr: &expr.ArrayDimFetch{
36 Position: &position.Position{
37 StartLine: 1,
38 EndLine: 1,
39 StartPos: 3,
40 EndPos: 8,
41 },
42 Variable: &expr.Variable{
43 Position: &position.Position{
44 StartLine: 1,
45 EndLine: 1,
46 StartPos: 3,
47 EndPos: 5,
48 },
49 VarName: &node.Identifier{
50 Position: &position.Position{
51 StartLine: 1,
52 EndLine: 1,
53 StartPos: 3,
54 EndPos: 5,
55 },
56 Value: "a",
57 },
58 },
59 Dim: &scalar.Lnumber{
60 Position: &position.Position{
61 StartLine: 1,
62 EndLine: 1,
63 StartPos: 6,
64 EndPos: 7,
65 },
66 Value: "1",
67 },
68 },
69 },
70 },
71 }
72
73 php7parser := php7.NewParser([]byte(src), "7.4")
74 php7parser.Parse()

Callers

nothing calls this directly

Calls 4

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…