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

Function TestArrayDimFetchNested

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

Source from the content-addressed store, hash-verified

82}
83
84func TestArrayDimFetchNested(t *testing.T) {
85 src := `<? $a[1][2];`
86
87 expected := &node.Root{
88 Position: &position.Position{
89 StartLine: 1,
90 EndLine: 1,
91 StartPos: 3,
92 EndPos: 12,
93 },
94 Stmts: []node.Node{
95 &stmt.Expression{
96 Position: &position.Position{
97 StartLine: 1,
98 EndLine: 1,
99 StartPos: 3,
100 EndPos: 12,
101 },
102 Expr: &expr.ArrayDimFetch{
103 Position: &position.Position{
104 StartLine: 1,
105 EndLine: 1,
106 StartPos: 3,
107 EndPos: 11,
108 },
109 Variable: &expr.ArrayDimFetch{
110 Position: &position.Position{
111 StartLine: 1,
112 EndLine: 1,
113 StartPos: 3,
114 EndPos: 8,
115 },
116 Variable: &expr.Variable{
117 Position: &position.Position{
118 StartLine: 1,
119 EndLine: 1,
120 StartPos: 3,
121 EndPos: 5,
122 },
123 VarName: &node.Identifier{
124 Position: &position.Position{
125 StartLine: 1,
126 EndLine: 1,
127 StartPos: 3,
128 EndPos: 5,
129 },
130 Value: "a",
131 },
132 },
133 Dim: &scalar.Lnumber{
134 Position: &position.Position{
135 StartLine: 1,
136 EndLine: 1,
137 StartPos: 6,
138 EndPos: 7,
139 },
140 Value: "1",
141 },

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…