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

Function TestMethodCall

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

Source from the content-addressed store, hash-verified

15)
16
17func TestMethodCall(t *testing.T) {
18 src := `<? $a->foo();`
19
20 expected := &node.Root{
21 Position: &position.Position{
22 StartLine: 1,
23 EndLine: 1,
24 StartPos: 3,
25 EndPos: 13,
26 },
27 Stmts: []node.Node{
28 &stmt.Expression{
29 Position: &position.Position{
30 StartLine: 1,
31 EndLine: 1,
32 StartPos: 3,
33 EndPos: 13,
34 },
35 Expr: &expr.MethodCall{
36 Position: &position.Position{
37 StartLine: 1,
38 EndLine: 1,
39 StartPos: 3,
40 EndPos: 12,
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 Method: &node.Identifier{
60 Position: &position.Position{
61 StartLine: 1,
62 EndLine: 1,
63 StartPos: 7,
64 EndPos: 10,
65 },
66 Value: "foo",
67 },
68 ArgumentList: &node.ArgumentList{
69 Position: &position.Position{
70 StartLine: 1,
71 EndLine: 1,
72 StartPos: 10,
73 EndPos: 12,
74 },

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…