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

Function TestFunctionCallRelative

node/expr/t_function_call_test.go:90–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestFunctionCallRelative(t *testing.T) {
91 src := `<? namespace\foo();`
92
93 expected := &node.Root{
94 Position: &position.Position{
95 StartLine: 1,
96 EndLine: 1,
97 StartPos: 3,
98 EndPos: 19,
99 },
100 Stmts: []node.Node{
101 &stmt.Expression{
102 Position: &position.Position{
103 StartLine: 1,
104 EndLine: 1,
105 StartPos: 3,
106 EndPos: 19,
107 },
108 Expr: &expr.FunctionCall{
109 Position: &position.Position{
110 StartLine: 1,
111 EndLine: 1,
112 StartPos: 3,
113 EndPos: 18,
114 },
115 Function: &name.Relative{
116 Position: &position.Position{
117 StartLine: 1,
118 EndLine: 1,
119 StartPos: 3,
120 EndPos: 16,
121 },
122 Parts: []node.Node{
123 &name.NamePart{
124 Position: &position.Position{
125 StartLine: 1,
126 EndLine: 1,
127 StartPos: 13,
128 EndPos: 16,
129 },
130 Value: "foo",
131 },
132 },
133 },
134 ArgumentList: &node.ArgumentList{
135 Position: &position.Position{
136 StartLine: 1,
137 EndLine: 1,
138 StartPos: 16,
139 EndPos: 18,
140 },
141 },
142 },
143 },
144 },
145 }
146
147 php7parser := php7.NewParser([]byte(src), "7.4")

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…